Exemplo n.º 1
0
 public IGridSquare Shoot(GridCoordinate coordinate)
 {
     /* Check if the coordinate is out of bound. */
     if (coordinate.IsOutOfBounds(Size) == false)
     {
         /* Call the HitByBomb method of the grid square.*/
         this.Squares[coordinate.Row, coordinate.Column].HitByBomb();
         return(this.Squares[coordinate.Row, coordinate.Column]);
     }
     else
     {
         /* Return exception when coordinate is not with the grid.*/
         throw new System.ApplicationException("Coordinate is out of bound");
     }
 }
Exemplo n.º 2
0
 public IGridSquare GetSquareAt(GridCoordinate coordinate)
 {
     /* Return the grid square with the requested coordinates. */
     return(this.Squares[coordinate.Row, coordinate.Column]);
 }
 public IGridSquare GetSquareAt(GridCoordinate coordinate)
 {
     return(this.Squares[coordinate.Row, coordinate.Column]);
 }
Exemplo n.º 4
0
 public IGridSquare Shoot(GridCoordinate coordinate)
 {
     throw new NotImplementedException("Shoot method of Grid class is not implemented");
 }
 public GridSquare(GridCoordinate coordinate)
 {
     this.Coordinate = coordinate;
 }
Exemplo n.º 6
0
 public GridSquare(GridCoordinate coordinate)
 {
     throw new NotImplementedException("Constructor of GridSquare class is not implemented");
 }
Exemplo n.º 7
0
 public GridSquare(GridCoordinate coordinate)
 {
     Status        = GridSquareStatus.Untouched;
     Coordinate    = coordinate;
     NumberOfBombs = 0;
 }