Пример #1
0
 public Level(LevelState initialState)
 {
     this.initialState = currentState = initialState;
     width             = initialState.width;
     height            = initialState.height;
     players           = initialState.CountActor(Actor.Player);
     history.Add(currentState.Clone());
     Console.WriteLine(initialState);
 }
Пример #2
0
        private bool Act(Func <bool> action)
        {
            bool success = action();

            if (success)
            {
                history.Add(currentState.Clone());
            }
            return(success);
        }