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);
 }
예제 #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);
        }
예제 #3
0
        public void SetUp()
        {
            _board = new BoardState();

            _validate = new BoardStateViewModel(_board, true, true);
        }
예제 #4
0
 public static void ResetBoards()
 {
     _thisPlayerBoardStateViewModel  = null;
     _otherPlayerBoardStateViewModel = null;
 }