Esempio n. 1
0
 // Results
 // Business constructor
 public Outcome(
     Game game
     ,Player winner
     ,int resigned
     )
 {
     InitializeResults();
     _game = new PredecessorObj<Game>(this, RoleGame, game);
     _winner = new PredecessorOpt<Player>(this, RoleWinner, winner);
     _resigned = resigned;
 }
Esempio n. 2
0
 // Business constructor
 public Player(
     User user
     ,Game game
     ,int index
     )
 {
     InitializeResults();
     _user = new PredecessorObj<User>(this, RoleUser, user);
     _game = new PredecessorObj<Game>(this, RoleGame, game);
     _index = index;
 }
Esempio n. 3
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Game newFact = new Game(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;
            }