예제 #1
0
 public GridSquare this[GridSquarePosition position]
 {
     get
     {
         return(Squares.Find(s => s.Position == position));
     }
 }
예제 #2
0
        protected Move makeMove(Grid grid, GridSquarePosition position)
        {
            Move move = new Move(Team, position);

            if (!grid[move.Position].IsVacant)
            {
                return(null);
            }
            else
            {
                grid.SetMove(move);
                return(move);
            }
        }
예제 #3
0
        private JsonResult makeHumanMove(GridSquarePosition position)
        {
            Move move;

            try
            {
                move = ((HumanPlayer)ActiveGame.Players.ActivePlayer).MakeMove(ActiveGame.Grid, position);
            }
            catch (Exception)
            {
                return(Json(new { status = "ERROR - Unable to make move"
                                  , position = String.Empty
                                  , gameStatus = String.Empty }));
            }

            return(getMoveOutput(move));
        }
예제 #4
0
 public Move MakeMove(Grid grid, GridSquarePosition position)
 {
     return(makeMove(grid, position));
 }
예제 #5
0
 public GridSquare(GridSquarePosition position, Team team)
 {
     Position = position;
     Team     = team;
 }
예제 #6
0
 public Move(Team team)
 {
     Team     = team;
     Position = GridSquarePosition.None;
 }
예제 #7
0
 public Move(Team team, GridSquarePosition position)
 {
     Team     = team;
     Position = position;
 }