Пример #1
0
        public LocalGameState(LocalGame game, MainNavigationModel mainNavigation)
        {
            _game = game;
            _mainNavigation = mainNavigation;

            _depGameBoardRaw = new Dependent(UpdateGameBoardRaw);
            _depGameBoard = new Dependent(UpdateGameBoard);
            _depPreviewBoard = new Dependent(UpdatePreviewBoard);
        }
Пример #2
0
 public LocalGameViewModel(LocalGame localGame, MainNavigationModel mainNavigation)
 {
     _gameState = new LocalGameState(localGame, mainNavigation);
     _mainNavigation = mainNavigation;
 }
Пример #3
0
 // Results
 // Business constructor
 public LocalOutcome(
     LocalGame game
     ,LocalPlayer winner
     ,int resigned
     )
 {
     InitializeResults();
     _game = new PredecessorObj<LocalGame>(this, RoleGame, game);
     _winner = new PredecessorOpt<LocalPlayer>(this, RoleWinner, winner);
     _resigned = resigned;
 }
Пример #4
0
 // Results
 // Business constructor
 public LocalPlayer(
     LocalGame game
     ,int index
     )
 {
     InitializeResults();
     _game = new PredecessorObj<LocalGame>(this, RoleGame, game);
     _index = index;
 }
Пример #5
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                LocalGame newFact = new LocalGame(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._unique = (Guid)_fieldSerializerByType[typeof(Guid)].ReadData(output);
                    }
                }

                return newFact;
            }