public void SetCellShip(Coordinates coordinates, ShipPiece shipPiece, int section, ShipOrientation orientation) { Cell cell; if (!Cells.TryGetValue(coordinates, out cell)) { cell = new Cell(); cell.Coordinates = coordinates; Cells.Add(coordinates, cell); } cell.ShipPiece = shipPiece; cell.ShipSection = section; cell.Orientation = orientation; }
public void SetCellState(Coordinates coordinates, CellState state) { Cell cell; if (!Cells.TryGetValue(coordinates, out cell)) { cell = new Cell(); cell.ShipPiece = ShipPiece.None; cell.ShipSection = 0; cell.Coordinates = coordinates; Cells.Add(coordinates, cell); } cell.State = state; }