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("ConversationTemplateParameter", new ConversationTemplateParameter(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 void Load(ParameterFactory factory) { foreach (var pair in parameterDefinitionProvider.Parameters) { if (pair.Value.StringValues != null) { SwitchStringParameter stringParameter = new SwitchStringParameter(pair.Value.StringValues); factory.Register(pair.Key, stringParameter); } else if (pair.Value.Values != null) { 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("PrevQuestParameter", new PrevQuestParameter(database)); factory.Register("GameobjectParameter", new GameobjectParameter(database)); factory.Register("GossipMenuParameter", new GossipMenuParameter(database)); factory.Register("NpcTextParameter", new NpcTextParameter(database)); factory.Register("ConversationTemplateParameter", new ConversationTemplateParameter(database)); factory.Register("BoolParameter", new BoolParameter()); factory.Register("FlagParameter", new FlagParameter()); }