// 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; }
// 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; }
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; }