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); }
private bool Act(Func <bool> action) { bool success = action(); if (success) { history.Add(currentState.Clone()); } return(success); }