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)); } } }
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; } } }