Skip to content

Commit

Permalink
Merge pull request eesast#132 from Grange007/dev
Browse files Browse the repository at this point in the history
chore: ✨ upgraded draw logic
  • Loading branch information
Grange007 authored Mar 23, 2024
2 parents b16528f + 3273726 commit 217596b
Show file tree
Hide file tree
Showing 13 changed files with 854 additions and 768 deletions.
14 changes: 7 additions & 7 deletions logic/Client/Model/MapPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ namespace Client.Model
{
public enum MapPatchType
{
Space = 0,
Ground = 0,
RedHome = 1,
BlueHome = 2,
Ruin = 3,
Shadow = 4,
Asteroid = 5,
Resource = 6,
Factory = 7,
Community = 8,
Fort = 9,
Grass = 4,
River = 5,
Garbage = 6,
RecycleBank = 7,
ChargeStation = 8,
SignalTower = 9,
WormHole = 10,
Null = 11
};
Expand Down
22 changes: 17 additions & 5 deletions logic/Client/Model/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace Client.Model
{
public class Player : BindableObject
{
private bool team;
public bool Team
private long team;
public long Team
{
get => team;
set
Expand Down Expand Up @@ -39,12 +39,24 @@ public int Money
OnPropertyChanged();
}
}
private ObservableCollection<Ship> ships;
public ObservableCollection<Ship> Ships

private int score;
public int Score
{
get => score;
set
{
score = value;
OnPropertyChanged();
}
}

private ObservableCollection<Sweeper> ships;
public ObservableCollection<Sweeper> Sweepers
{
get
{
return ships ?? (ships = new ObservableCollection<Ship>());
return ships ?? (ships = new ObservableCollection<Sweeper>());
}
set
{
Expand Down
134 changes: 69 additions & 65 deletions logic/Client/Model/Ship.cs
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
using System;
using Client.Util;
using Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Model
{
public enum TeamEnum
{
Red,
Blue
}
//public enum TeamEnum
//{
// Red,
// Blue
//}

public enum TypeEnum
{
CivilShip,
WarShip,
FlagShip
}
//public enum TypeEnum
//{
// CivilSweeper,
// WarSweeper,
// FlagSweeper
//}

public enum StateEnum
{
Idle,
Producing,
Constructing,
Recovering,
Recycling,
Attacking,
Swinging,
Deceased
}
//public enum StateEnum
//{
// Idle,
// Producing,
// Constructing,
// Recovering,
// Recycling,
// Attacking,
// Swinging,
// Deceased
//}

public enum ProducerModuleEnum
{
//public enum ProducerModuleEnum
//{

}
//}

public enum ConstuctorModuleEnum
{
//public enum ConstuctorModuleEnum
//{

}
//}

public enum ArmorModuleEnum
{
//public enum ArmorModuleEnum
//{

}
//}

public enum ShieldModuleEnum
{
//public enum ShieldModuleEnum
//{

}
//}

public enum AttackerModuleEnum
{
//public enum AttackerModuleEnum
//{

}
//}

public class Ship : BindableObject
public class Sweeper : BindableObject
{
private TeamEnum team;
private TypeEnum type;
private StateEnum state;
private long teamID;
private SweeperType type;
private SweeperState state;
private int Hp;
private ProducerModuleEnum producerModule;
private ConstuctorModuleEnum constuctorModule;
private ArmorModuleEnum armorModule;
private ShieldModuleEnum shieldModule;
private AttackerModuleEnum attackerModule;
private ProducerType producerModule;
private ConstructorType constuctorModule;
private ArmorType armorModule;
private ShieldType shieldModule;
private WeaponType weaponModule;
private string type_s;
private string state_s;
private string producerModule_s;
private string constuctorModule_s;
private string armorModule_s;
private string shieldModule_s;
private string attackerModule_s;
public TeamEnum Team
private string weaponModule_s;


public long TeamID
{
get => team;
get => teamID;
set
{
team = value;
teamID = value;
OnPropertyChanged();
}
}
public TypeEnum Type
public SweeperType Type
{
get => type;
set
Expand All @@ -92,7 +96,7 @@ public TypeEnum Type
OnPropertyChanged();
}
}
public StateEnum State
public SweeperState State
{
get => state;
set
Expand All @@ -110,7 +114,7 @@ public int HP
OnPropertyChanged();
}
}
public ProducerModuleEnum ProducerModule
public ProducerType ProducerModule
{
get => producerModule;
set
Expand All @@ -119,7 +123,7 @@ public ProducerModuleEnum ProducerModule
OnPropertyChanged();
}
}
public ConstuctorModuleEnum ConstuctorModule
public ConstructorType ConstuctorModule
{
get => constuctorModule;
set
Expand All @@ -128,7 +132,7 @@ public ConstuctorModuleEnum ConstuctorModule
OnPropertyChanged();
}
}
public ArmorModuleEnum ArmorModule
public ArmorType ArmorModule
{
get => armorModule;
set
Expand All @@ -137,7 +141,7 @@ public ArmorModuleEnum ArmorModule
OnPropertyChanged();
}
}
public ShieldModuleEnum ShieldModule
public ShieldType ShieldModule
{
get => shieldModule;
set
Expand All @@ -146,18 +150,18 @@ public ShieldModuleEnum ShieldModule
OnPropertyChanged();
}
}
public AttackerModuleEnum AttackerModule
public WeaponType WeaponModule
{
get => attackerModule;
get => weaponModule;
set
{
attackerModule = value;
weaponModule = value;
OnPropertyChanged();
}
}
public string Type_s
{
get => type_s;
get => UtilInfo.SweeperTypeNameDict[Type];
set
{
type_s = value;
Expand All @@ -166,7 +170,7 @@ public string Type_s
}
public string State_s
{
get => state_s;
get => UtilInfo.SweeperStateNameDict[State];
set
{
state_s = value;
Expand Down Expand Up @@ -209,12 +213,12 @@ public string ShieldModule_s
OnPropertyChanged();
}
}
public string AttackerModule_s
public string WeaponModule_s
{
get => attackerModule_s;
get => weaponModule_s;
set
{
attackerModule_s = value;
weaponModule_s = value;
OnPropertyChanged();
}
}
Expand Down
1 change: 1 addition & 0 deletions logic/Client/Old/GameStatusBar.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Client.Util;
using Protobuf;

namespace Client;
Expand Down
18 changes: 9 additions & 9 deletions logic/Client/Old/PlayerStatusBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Label x:Name="MyMoney" Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="3" Text=" 💰总经济:" Style="{StaticResource littleAttributes}" />
</Grid>

<Grid x:Name="ShipStatusAttributesGrid" Grid.Row="1">
<Grid x:Name="SweeperStatusAttributesGrid" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
Expand All @@ -45,16 +45,16 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Label x:Name="ShipItem" Grid.Row="1" Grid.Column="0" Text="单位👾" FontSize="Micro"/>
<Label x:Name="ShipMining" Grid.Row="1" Grid.Column="1" Text="采集模块" FontSize="Micro"/>
<Label x:Name="ShipBuild" Grid.Row="1" Grid.Column="2" Text="建造模块" FontSize="Micro"/>
<Label x:Name="ShipArmor" Grid.Row="1" Grid.Column="3" Text="装甲模块" FontSize="Micro"/>
<Label x:Name="ShipShield" Grid.Row="1" Grid.Column="4" Text="护盾模块" FontSize="Micro"/>
<Label x:Name="ShipAttack" Grid.Row="1" Grid.Column="5" Text="攻击模块" FontSize="Micro"/>
<Label x:Name="ShipState" Grid.Row="1" Grid.Column="6" Text="状态✨️" FontSize="Micro"/>
<Label x:Name="SweeperItem" Grid.Row="1" Grid.Column="0" Text="单位👾" FontSize="Micro"/>
<Label x:Name="SweeperMining" Grid.Row="1" Grid.Column="1" Text="采集模块" FontSize="Micro"/>
<Label x:Name="SweeperBuild" Grid.Row="1" Grid.Column="2" Text="建造模块" FontSize="Micro"/>
<Label x:Name="SweeperArmor" Grid.Row="1" Grid.Column="3" Text="装甲模块" FontSize="Micro"/>
<Label x:Name="SweeperShield" Grid.Row="1" Grid.Column="4" Text="护盾模块" FontSize="Micro"/>
<Label x:Name="SweeperAttack" Grid.Row="1" Grid.Column="5" Text="攻击模块" FontSize="Micro"/>
<Label x:Name="SweeperState" Grid.Row="1" Grid.Column="6" Text="状态✨️" FontSize="Micro"/>
</Grid>

<Grid x:Name="ShipAllAttributesGrid" Grid.Row="2" >
<Grid x:Name="SweeperAllAttributesGrid" Grid.Row="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
Expand Down
Loading

0 comments on commit 217596b

Please sign in to comment.