Ejemplo n.º 1
0
 public GameStateFactory(PlayState.Factory playFactory,
                         HelpState.Factory helpFactory,
                         CreditsState.Factory creditsFactory,
                         ExitState.Factory exitFactory)
 {
     this.playFactory    = playFactory;
     this.helpFactory    = helpFactory;
     this.creditsFactory = creditsFactory;
     this.exitFactory    = exitFactory;
 }
Ejemplo n.º 2
0
 public GameStateMachine(
     GameConfig config,
     InitState.Factory initStateFactory,
     TitleState.Factory titleStateFactory,
     PlayState.Factory playStateFactory,
     GameOverState.Factory gameOverStateFactory,
     WinState.Factory winStateFactory
     )
 {
     _config = config;
     _states = new Dictionary <GameStates, IState> {
         { GameStates.Init, initStateFactory.Create(this) },
         { GameStates.Title, titleStateFactory.Create(this) },
         { GameStates.Play, playStateFactory.Create(this) },
         { GameStates.GameOver, gameOverStateFactory.Create(this) },
         { GameStates.Win, winStateFactory.Create(this) },
     };
 }