test sonar
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 1 year ago
parent 51d771537f
commit 3044de9796

@ -14,16 +14,13 @@ namespace QwirkleClassLibrary
public bool GameRunning { get; private set; } public bool GameRunning { get; private set; }
private Board board; private Board board;
public ReadOnlyCollection<Player> PlayerList { get; } public ReadOnlyCollection<Player> PlayerList => players.AsReadOnly();
private readonly List<Player> players; private readonly List<Player> players = new();
public Game() public Game()
{ {
board = new Board(); board = new Board();
bag = new TileBag(3); bag = new TileBag(3);
players = new List<Player>();
PlayerList = players.AsReadOnly();
} }
public bool AddPlayerInGame(string? playerTag) public bool AddPlayerInGame(string? playerTag)

@ -10,7 +10,7 @@ namespace QwirkleClassLibrary
public class Player public class Player
{ {
public ReadOnlyCollection<Tile> Tiles => playerTiles.AsReadOnly(); public ReadOnlyCollection<Tile> Tiles => playerTiles.AsReadOnly();
private readonly List<Tile> playerTiles; private readonly List<Tile> playerTiles = new();
public Player(string name) public Player(string name)
{ {
@ -20,8 +20,6 @@ namespace QwirkleClassLibrary
} }
NameTag = name; NameTag = name;
playerTiles = new List<Tile>();
} }
public string NameTag { get; } public string NameTag { get; }

Loading…
Cancel
Save