Exemplo n.º 1
0
        private void CreateGates(Configs.DungeonConfig dungeonCfg, DungeonLogic dungeonLogic)
        {
            foreach (GateConfig gateConfig in dungeonCfg.ShowGateList())
            {
                Type gateClass = Type.GetType(gateConfig.ClassName());
                Gates.GateController gateController = (Gates.GateController)gateClass
                                                      .GetConstructor(new[] { typeof(int), typeof(Environment.Environment) })
                                                      .Invoke(new object[] { gateConfig.Id(), defaultEnvironment });
                gateClass.GetMethod("SetCookies").Invoke(gateController, new[] { gateConfig.CookiesList() });

                dungeonLogic.AddGate(gateController);
            }
        }
Exemplo n.º 2
0
        private void CreateStageActivators(Configs.DungeonConfig dungeonConfigCfg, DungeonLogic dungeonLogic)
        {
            foreach (StageActivatorConfig stageActivatorConfig in dungeonConfigCfg.StageActivatorList())
            {
                Type stageActivatorClass = Type.GetType(stageActivatorConfig.ClassName());
                StageActivators.StageActivator stageActivator =
                    (StageActivators.StageActivator)stageActivatorClass
                    .GetConstructor(new[] { typeof(Environment.Environment) })
                    .Invoke(new object[] { defaultEnvironment });
                stageActivatorClass.GetMethod("SetCookies")
                .Invoke(stageActivator, new[] { stageActivatorConfig.CookiesList() });

                dungeonLogic.AddStageActivator(stageActivator);
            }
        }