public void Load(string file) { scenarioContainer = XmlIO.LoadXml <ScenarioContainer>(file); AddStageInfoToDict(); AddCreateCharType2DToDict(); AddCreateChar2DToDict(); AddCreateChar3DToDict(); AddCreateObjType2DToDict(); AddCreateObj2DToDict(); AddCreateObj3DToDict(); AddStageSetToDict(); AddTextEventToDict(); AddPopUpEventToDict(); AddCardPopUpEventToDict(); AddSpeechBubbleOnEventToDict(); AddSphereImageOnEventToDict(); AddLoadSceneEventToDict(); AddQuarterEventToDict(); AddQuarterSelectEventToDict(); AddQuizEventToDict(); AddCaptureEventToDict(); AddPanelPopEventToDict(); AddTableSettingEventToDict(); AddSelectItemEventToDict(); AddBranchToDict(); AddInputFieldEventToDict(); AddVideoPlayEventToDict(); AddTouchGameEventToDict(); AddDeleteBlurEventToDict(); AddPaintEventToDict(); }
public void Run() { var dataFlowProgress = new DataFlowProgress(); var scenarioContainer = new ScenarioContainer(dataFlowProgress); var dataFlowMediator = new DataFlowMediator(scenarioContainer); dataFlowProgress.ProgressChanged += DataFlowProgress_ProgressChanged; var scenario = new Scenario("s1"); dataFlowMediator.AddScenario(scenario); Console.WriteLine("--add DataTable node"); dataFlowMediator.AddNode(scenario, new AddNodeRequest() { Location = "0", TypeId = "DataTable" }); Task.Delay(TimeSpan.FromMilliseconds(200)).Wait(); Console.WriteLine("--get DataTable config"); var dataTableConfig = dataFlowMediator.GetConfig(scenario, GetNode("DataTable").Id); Console.WriteLine("--change DataTable config"); var dic = new Dictionary <string, List <string> > { }; dic.Add("t1", new List <string>() { "c1", "c2" }); dataFlowMediator.ChangeConfig(scenario, new ChangeConfigRequest() { config = new DataTableConfig() { Tables = dic }, nodeId = GetNode("DataTable").Id, }); Console.WriteLine("--add SwitchPort node"); dataFlowMediator.AddNode(scenario, new AddNodeRequest() { Location = "1", TypeId = "SwitchPort" }); Task.Delay(TimeSpan.FromMilliseconds(200)).Wait(); Console.WriteLine("--add DataTable-SwitchPort link"); dataFlowMediator.AddLink(scenario, new AddLinkRequest() { SourceId = GetNode("DataTable").Id, TargetId = GetNode("SwitchPort").Id, SourceMapLink = (GetNode("DataTable").OutputPorts as MultipleSpecificPort).Ports.First().TypeId, }); Task.Delay(TimeSpan.FromMilliseconds(200)).Wait(); Console.WriteLine("--get SwitchPort config"); var switchPortConfig = dataFlowMediator.GetConfig(scenario, GetNode("SwitchPort").Id); Console.WriteLine("--change SwitchPort config"); dataFlowMediator.ChangeConfig(scenario, new ChangeConfigRequest() { config = new SwitchPortConfig() { Columns = new List <string> { "c1", "c2" } }, nodeId = GetNode("SwitchPort").Id, }); Console.WriteLine("--run SwitchPort node"); dataFlowMediator.Run(scenario, new RunRequest() { NodeIds = new List <string>() { _nodeStatusList.Last().Id } }); }