public ConfigureBoardViewModel()
 {
     LockInLayoutCommand = new Command(LockInLayoutAsync,
                                       () => ConfiguringBoard.Cells.SelectMany(c => c).Count(c => c.Ship != null) ==
                                       BoardStateViewModel.AmountOfCellsWithShips);
     ConfiguringBoard = new BoardStateViewModel(new BoardState(), true, true);
 }
Ejemplo n.º 2
0
        public static BoardStateViewModel OtherPlayerBoard(this Game game)
        {
            var board = game.ThisPlayerIsGameCreator()
                                ? game.RunningGameState.BoardParticipant
                                : game.RunningGameState.BoardCreator;

            if (_otherPlayerBoardStateViewModel == null)
            {
                _otherPlayerBoardStateViewModel = new BoardStateViewModel(board, false, true);
            }
            else
            {
                _otherPlayerBoardStateViewModel.Model = board;
            }

            return(_otherPlayerBoardStateViewModel);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            _board = new BoardState();

            _validate = new BoardStateViewModel(_board, true, true);
        }
Ejemplo n.º 4
0
 public static void ResetBoards()
 {
     _thisPlayerBoardStateViewModel  = null;
     _otherPlayerBoardStateViewModel = null;
 }