Beispiel #1
0
        public IfBlockExecuter(WaitForTokenHandler waitForTokenHandler, WaitForReTokenHandler waitForReTokenHandler, MatchWaitTokenHandler matchWaitTokenHandler)
        {
            _tokenizer = new Tokenizer(TokenDefinitionRegistry.Default().Definitions());
            _tokenHandlers = new SimpleDictionary<string, ITokenHandler>();

            _tokenHandlers["exit"] = new ExitTokenHandler();
            _tokenHandlers["comment"] = new ContinueTokenHandler();
            _tokenHandlers["debuglevel"] = new DebugLevelTokenHandler();
            _tokenHandlers["var"] = new VarTokenHandler();
            _tokenHandlers["unvar"] = new UnVarTokenHandler();
            _tokenHandlers["hasvar"] = new HasVarTokenHandler();
            _tokenHandlers["goto"] = new GotoTokenHandler();
            _tokenHandlers["waitfor"] = waitForTokenHandler;
            _tokenHandlers["waitforre"] = waitForReTokenHandler;
            _tokenHandlers["pause"] = new PauseTokenHandler();
            _tokenHandlers["put"] = new SendCommandTokenHandler();
            _tokenHandlers["echo"] = new EchoTokenHandler();
            _tokenHandlers["match"] = new MatchTokenHandler();
            _tokenHandlers["matchre"] = new MatchTokenHandler();
            _tokenHandlers["matchwait"] = matchWaitTokenHandler;
            _tokenHandlers["save"] = new SaveTokenHandler();
            _tokenHandlers["move"] = new MoveTokenHandler();
            _tokenHandlers["nextroom"] = new NextroomTokenHandler();
            _tokenHandlers["send"] = new SendTokenHandler();
            _tokenHandlers["parse"] = new ParseTokenHandler();
            _tokenHandlers["containsre"] = new ContainsReTokenHandler();
            _tokenHandlers["gosub"] = new GoSubTokenHandler();
            _tokenHandlers["return"] = new ReturnTokenHandler();
        }
        public CommandProcessor(IServiceLocator services, IVariableReplacer variableReplacer, IScriptLog scriptLog)
        {
            _services = services;
            _variableReplacer = variableReplacer;
            _scriptLog = scriptLog;
            _tokenizer = Tokenizer.With(TokenDefinitionRegistry.ClientCommands());

            _tokenHandlers = new SimpleDictionary<string, ITokenHandler>();
            _tokenHandlers["script"] = new ScriptTokenHandler();
            _tokenHandlers["scriptcommand"] = new ScriptCommandTokenHandler();
            _tokenHandlers["send"] = new SendTokenHandler();
            _tokenHandlers["globalvar"] = new GlobalVarTokenHandler();
            _tokenHandlers["parse"] = new ParseTokenHandler();
        }