public override void Initialization() { price = FactoryManager.Build <Price>(node.GetNode("price"), GetContext()); reward = FactoryManager.Build <Reward>(node.GetNode("reward"), GetContext()); requirement = FactoryManager.Build <Requirement>(node.GetNode("requirement"), GetContext()); amount = FactoryManager.Build <Amount>(node.GetNode("amount"), GetContext()); }
protected virtual TValue Factory(RawNode partialNode) { if (GetContext() == null) { return(FactoryManager.Build <TValue>(partialNode)); } return(FactoryManager.Build <TValue>(partialNode, GetContext())); }
public CompositeRewardResult(RawNode node, IContext context) : base(node, context) { var rawResults = node.GetRawNodeArray("results"); results = new IRewardResult[rawResults.Length]; for (var i = 0; i < rawResults.Length; i++) { results[i] = FactoryManager.Build <RewardResult>(rawResults[i], context); } }
public Reward(RawNode node, IContext context) : base(node, context) { type = node.GetString("type"); if (node.CheckKey("choice")) { choice = FactoryManager.Build <PathChoice>(node.GetNode("choice"), context); } else { if (node.CheckKey("path")) { path = PathUtil.GetModelPath(GetContext(), node.GetNode("path")); } } }
public SomeModel(RawNode initNode, SomeModelCategories categories, SomeModelDescription description, IContext context) : base(initNode, categories, description, context) { int value = description.amount.Number(); var result = description.reward.Calculate(); var s = result.Serialize(); var sResult = FactoryManager.Build <RewardResult>(new RawNode(s), context); description.reward.Award(sResult); description.reward.Award(); description.reward.Award(); description.reward.Award(); description.reward.Award(); if (description.requirement.Check()) { description.price.Pay(); } }
public override void Initialization() { requirement = FactoryManager.Build <Requirement>(node.GetNode("requirement"), GetContext()); }
protected WrappedRequirement(RawNode node, IContext context) : base(node, context) { innerRequirement = FactoryManager.Build <Requirement>(node.GetNode("requirement"), context); }
protected WrappedPrice(RawNode node, IContext context) : base(node, context) { innerPrice = FactoryManager.Build <Price>(node.GetNode("price"), context); }
protected WrappedReward(RawNode rawNode, IContext context) : base(rawNode, context) { innerReward = FactoryManager.Build <Reward>(rawNode.GetNode("reward"), context); }
public RenewableResourceReward(RawNode node, IContext context) : base(node, context) { _amount = FactoryManager.Build <Amount>(node.GetNode("amount"), context); }
public override void Initialization() { reward = FactoryManager.Build <Reward>(node.GetNode("reward"), GetContext()); }
public SimpleResourceReward(RawNode node, IContext context = null) : base(node, context) { amount = FactoryManager.Build <Amount>(node.GetNode("amount"), context); }
public WrappedRewardResult(RawNode node, IContext context) : base(node, context) { rewardResult = FactoryManager.Build <RewardResult>(node.GetNode("result"), context); }
protected override Trigger Factory(RawNode initNode, TriggerDescription description) { return((Trigger)FactoryManager.Build(typeof(Trigger), description.type, initNode, categories, description, GetContext())); }
public Random(RawNode initNode, RandomCategories categories, RandomDescription description, IContext context) : base(initNode, categories, description, context) { _seed = initNode.GetInt("seed"); _random = (IRandomImplementation)FactoryManager.Build(typeof(IRandomImplementation), description.type); }
protected DynamicWrappedReward(RawNode node, IContext context) : base(node, context) { innerReward = FactoryManager.Build <DynamicReward>(node.GetNode("reward"), context); }