Пример #1
0
        public void Load(ParameterFactory factory)
        {
            foreach (var pair in parameterDefinitionProvider.Parameters)
            {
                Parameter p = pair.Value.IsFlag ? new FlagParameter() : new Parameter();
                p.Items = pair.Value.Values;
                factory.Register(pair.Key, p);
            }

            factory.Register("FloatParameter", new FloatIntParameter(1000));
            factory.Register("DecifloatParameter", new FloatIntParameter(100));
            factory.Register("GameEventParameter", new GameEventParameter(database));
            factory.Register("CreatureParameter", new CreatureParameter(database));
            factory.Register("QuestParameter", new QuestParameter(database));
            factory.Register("GameobjectParameter", new GameobjectParameter(database));
            factory.Register("BoolParameter", new BoolParameter());
            factory.Register("FlagParameter", new FlagParameter());
        }
        public void Load(ParameterFactory factory)
        {
            var data   = File.ReadAllText("Data/parameters.json");
            var models = JsonConvert.DeserializeObject <Dictionary <string, ParameterSpecModel> >(data);

            foreach (var key in models.Keys)
            {
                factory.Add(key, models[key]);
            }

            factory.Register("FloatParameter", (s) => new FloatIntParameter(s));

            factory.Register("CreatureParameter", (s) => new CreatureParameter(s, _container));

            factory.Register("QuestParameter", (s) => new QuestParameter(s, _container));

            factory.Register("GameobjectParameter", (s) => new GameobjectParameter(s, _container));

            factory.Register("BoolParameter", (s) => new BoolParameter(s));
        }
 public ParametersConfiguration(ParameterFactory factory)
 {
     this.factory = factory;
 }
Пример #4
0
 public void RegisterTypes(IContainerRegistry containerRegistry)
 {
     FactoryInstance = new ParameterFactory();
     containerRegistry.RegisterInstance <IParameterFactory>(FactoryInstance);
 }