Exemple #1
0
        private void RegisterHandlers(Engine engine)
        {
            var bombSettings = new BombSettings();

            engine.Use<LogHandler>();
            engine.Use(new ConfidenceHandler(0.9));

            engine.Use<AlphabetHandler>();
            engine.Use<ColorHandler>();
            engine.Use<NumberHandler>();
            engine.Use<YesOrNoHandler>();

            engine.Use(new AgainHandler());

            var memoryHandler = new MemoryHandler();
            var sequencesHandler = new SequencesHandler();
            var passwordsHandler = new PasswordsHandler();

            engine.Use<HelloHandler>();
            engine.Use(new BombHandler(bombSettings, memoryHandler, sequencesHandler, passwordsHandler));
            engine.Use(new WiresHandler(bombSettings));
            engine.Use(new ButtonHandler(bombSettings));
            engine.Use<KeypadHandler>();
            engine.Use(new SimonHandler(bombSettings));
            engine.Use(memoryHandler);
            engine.Use(sequencesHandler);
            engine.Use(passwordsHandler);
        }
 public BombHandler(
     BombSettings settings,
     MemoryHandler memoryHandler,
     SequencesHandler sequencesHandler,
     PasswordsHandler passwordsHandler
 )
     : base("Bomb")
 {
     this.settings = settings;
     this.memoryHandler = memoryHandler;
     this.sequencesHandler = sequencesHandler;
     this.passwordsHandler = passwordsHandler;
 }