示例#1
0
        public void ParseScripts()
        {
            MessageWindows.Clear();
            ScriptCommands.Clear();

            if (Scripts == null)
            {
                return;
            }

            foreach (AsmModule child in Scripts.GetOrderedModules())
            {
                foreach (AsmEvent evt in child.GetOrderedEvents())
                {
                    AsmCommandFactory factory = new AsmCommandFactory(evt);
                    factory.RegisterCreateHandler <AsmSetPlaceCommand>(OnAsmSetPlace);
                    factory.RegisterCreateHandler <AsmMessageCommand>(OnMessageWindowCommandCreated);
                    factory.RegisterCreateHandler <AsmAppearMessageCommand>(OnMessageWindowCommandCreated);
                    factory.RegisterCreateHandler <AsmAppearMessageAndWaitCommand>(OnMessageWindowCommandCreated);
                    factory.RegisterCreateHandler <AsmResumeScriptAppearMessageAndWaitCommand>(OnMessageWindowCommandCreated);
                    factory.RegisterCreateHandler <AsmAskCommand>(OnMessageWindowCommandCreated);
                    factory.RegisterCreateHandler <AsmAppearAskCommand>(OnMessageWindowCommandCreated);
                    ScriptCommands.AddRange(factory.FindAll(JsmCommand.SETPLACE, JsmCommand.MES, JsmCommand.AMES, JsmCommand.AMESW, JsmCommand.RAMESW, JsmCommand.ASK, JsmCommand.AASK));
                }
            }
        }
示例#2
0
        private void Construct(AsmModule module)
        {
            AsmCommandFactory factory = new AsmCommandFactory(module.Construct);

            switch (module.Type)
            {
            case JsmModuleType.Object:
            {
                AsmSetCharacterCommand cmd = factory.TryFind <AsmSetCharacterCommand>(JsmCommand.SETPC);
                if (cmd != null)
                {
                    ((AsmObject)module).CharacterId = cmd.TryResolveCharacterId();
                }
                break;
            }
            }
        }