diff --git a/Qwirkle/QwirkleClassLibrary/Board.cs b/Qwirkle/QwirkleClassLibrary/Board.cs index f58dc12..9bd1c95 100644 --- a/Qwirkle/QwirkleClassLibrary/Board.cs +++ b/Qwirkle/QwirkleClassLibrary/Board.cs @@ -9,33 +9,32 @@ namespace QwirkleClassLibrary { public class Board { - private List Cells; + private List cells; public IReadOnlyCollection ReadCells { get; private set; } - // ReadCells = Cells.AsReadOnly; public Board() { - Cells = new List(); + cells = new List(); for (int i = 0; i < 12; i++) { for (int j = 0; j < 12; j++) { Cell localcell = new(i, j); - Cells.Add(localcell); + cells.Add(localcell); } } } public bool AddTileInCell(int x, int y, Tile tile) { - for (int i = 0; i < Cells.Count; i++) + for (int i = 0; i < cells.Count; i++) { - if (this.Cells[i].GetX == x && this.Cells[i].GetY == y) + if (this.cells[i].GetX == x && this.cells[i].GetY == y) { - if (Cells[i].IsFree == true) + if (cells[i].IsFree == true) { - return Cells[i].SetTile(tile); + return cells[i].SetTile(tile); } } diff --git a/Qwirkle/QwirkleClassLibrary/Tile.cs b/Qwirkle/QwirkleClassLibrary/Tile.cs index d57db8b..df68a5f 100644 --- a/Qwirkle/QwirkleClassLibrary/Tile.cs +++ b/Qwirkle/QwirkleClassLibrary/Tile.cs @@ -23,6 +23,7 @@ namespace QwirkleClassLibrary { return color.ToString() + shape.ToString(); } + public Shape GetShape { get { return this.shape; } @@ -35,7 +36,7 @@ namespace QwirkleClassLibrary public override string ToString() { - return shape.ToString() + color.ToString(); + return color.ToString() + shape.ToString(); } } } \ No newline at end of file diff --git a/Qwirkle/QwirkleClassLibrary/TileBag.cs b/Qwirkle/QwirkleClassLibrary/TileBag.cs index 42c9982..d7b7e11 100644 --- a/Qwirkle/QwirkleClassLibrary/TileBag.cs +++ b/Qwirkle/QwirkleClassLibrary/TileBag.cs @@ -27,6 +27,11 @@ namespace QwirkleClassLibrary } TilesBag = tiles.AsReadOnly(); } + + public void AddTileInBag(Tile tile) + { + tiles.Add(tile); + } public void RemoveTileInBag(Tile tile) { @@ -39,6 +44,4 @@ namespace QwirkleClassLibrary } } } - -} - +} \ No newline at end of file