Browse Source

refactor: 🚧 fix the IntToPlaceType

tags/0.1.0
shangfengh 2 years ago
parent
commit
4df5613ab9
4 changed files with 36 additions and 12 deletions
  1. +21
    -10
      logic/Client/MainWindow.xaml.cs
  2. +5
    -0
      logic/Preparation/Utility/XY.cs
  3. +7
    -1
      logic/Server/GameServer.cs
  4. +3
    -1
      logic/cmd/gameServer.cmd

+ 21
- 10
logic/Client/MainWindow.xaml.cs View File

@@ -824,12 +824,13 @@ namespace Client
}
foreach (var data in listOfClassroom)
{
int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfFixedGenerator);
TextBox icon = new()
{
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString((int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfFixedGenerator)),
Text = Convert.ToString(deg),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
@@ -837,16 +838,21 @@ namespace Client
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
if (deg == 100)
{
icon.Text = "🅰";
}
UpperLayerOfMap.Children.Add(icon);
}
foreach (var data in listOfChest)
{
int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedChest);
TextBox icon = new()
{
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString((int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedChest)),
Text = Convert.ToString(deg),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
@@ -854,18 +860,18 @@ namespace Client
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
if (deg == 100)
{
icon.Text = "😄";
}
UpperLayerOfMap.Children.Add(icon);
}
foreach (var data in listOfGate)
{
int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedDoorway);
if (deg == 100)
{
gateOpened = true;
}
TextBox icon = new()
{
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString(deg),
@@ -876,13 +882,18 @@ namespace Client
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
if (deg == 100)
{
gateOpened = true;
icon.Text = "😄";
}
UpperLayerOfMap.Children.Add(icon);
}
foreach (var data in listOfDoor)
{
TextBox icon = new()
{
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 9 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
HorizontalAlignment = HorizontalAlignment.Left,


+ 5
- 0
logic/Preparation/Utility/XY.cs View File

@@ -79,5 +79,10 @@ namespace Preparation.Utility
{
throw new NotImplementedException();
}

public override int GetHashCode()
{
throw new NotImplementedException();
}
}
}

+ 7
- 1
logic/Server/GameServer.cs View File

@@ -240,7 +240,13 @@ namespace Server
{
switch (n)
{
case 0: return Protobuf.PlaceType.Land;
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return Protobuf.PlaceType.Land;
case 6: return Protobuf.PlaceType.Wall;
case 7: return Protobuf.PlaceType.Grass;
case 8: return Protobuf.PlaceType.Classroom;


+ 3
- 1
logic/cmd/gameServer.cmd View File

@@ -12,4 +12,6 @@ start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --ch

ping -n 2 127.0.0.1 > NUL

start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 1 --type 1 --occupation 1
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 1 --type 1 --occupation 1

ping -n 2 127.0.0.1 > NUL

Loading…
Cancel
Save