code smell bye bye
continuous-integration/drone/push Build is passing Details

test_old_branch
rportet 11 months ago
parent 4dd8210b0f
commit 004a7c190c

@ -27,7 +27,7 @@ namespace QwirkleClassLibrary.Games
public bool GameRunning { get; set; } public bool GameRunning { get; set; }
[DataMember] [DataMember]
private Board board = new Board(15, 12); private Board board = new(15, 12);
public bool PlayerSwapping { get; set; } public bool PlayerSwapping { get; set; }
public Board Board => board; public Board Board => board;
@ -35,15 +35,15 @@ namespace QwirkleClassLibrary.Games
public ReadOnlyCollection<Player> PlayerList => players.AsReadOnly(); public ReadOnlyCollection<Player> PlayerList => players.AsReadOnly();
[DataMember] [DataMember]
private readonly List<Player> players = new(); private readonly List<Player> players = [];
[DataMember] [DataMember]
private readonly Dictionary<Player, int> scoreBoard = new(); private readonly Dictionary<Player, int> scoreBoard = [];
public ReadOnlyDictionary<Player, int> ScoreBoard => scoreBoard.AsReadOnly(); public ReadOnlyDictionary<Player, int> ScoreBoard => scoreBoard.AsReadOnly();
[DataMember] [DataMember]
private readonly List<Cell> cellUsed = new(); private readonly List<Cell> cellUsed = [];
public ReadOnlyCollection<Cell> CellsUsed => cellUsed.AsReadOnly(); public ReadOnlyCollection<Cell> CellsUsed => cellUsed.AsReadOnly();

@ -37,7 +37,7 @@ namespace QwirkleClassLibrary.Players
} }
NameTag = name; NameTag = name;
Tiles = new ObservableCollection<Tile>(); Tiles = [];
} }
[DataMember] [DataMember]

@ -12,7 +12,7 @@ namespace QwirkleClassLibrary.Tiles
public class TileBag public class TileBag
{ {
[DataMember] [DataMember]
private readonly List<Tile> tiles = new List<Tile>(); private readonly List<Tile> tiles = [];
public ReadOnlyCollection<Tile> TilesBag { get; private set; } public ReadOnlyCollection<Tile> TilesBag { get; private set; }
@ -35,7 +35,7 @@ namespace QwirkleClassLibrary.Tiles
{ {
foreach (Color c in Enum.GetValues(typeof(Color))) foreach (Color c in Enum.GetValues(typeof(Color)))
{ {
Tile t = new Tile(s, c); Tile t = new(s, c);
tiles.Add(t); tiles.Add(t);
} }
} }

Loading…
Cancel
Save