public void LoadGame(GameMemento memento) { _state = memento.GetState(); }
public GameMemento(GameState state) { _state = state; }
private GameState _state = new GameState(100, 0);//Health & Killed Monsters public void Play() { //During this Play method game's state is continuously changed Console.WriteLine(_state.ToString()); _state = new GameState((int)(_state.Health * 0.9), _state.KilledMonsters + 2); }