コード例 #1
0
 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());
 }
コード例 #2
0
        protected virtual TValue Factory(RawNode partialNode)
        {
            if (GetContext() == null)
            {
                return(FactoryManager.Build <TValue>(partialNode));
            }

            return(FactoryManager.Build <TValue>(partialNode, GetContext()));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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"));
                }
            }
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 public override void Initialization()
 {
     requirement = FactoryManager.Build <Requirement>(node.GetNode("requirement"), GetContext());
 }
コード例 #7
0
 protected WrappedRequirement(RawNode node, IContext context) : base(node, context)
 {
     innerRequirement = FactoryManager.Build <Requirement>(node.GetNode("requirement"), context);
 }
コード例 #8
0
 protected WrappedPrice(RawNode node, IContext context) : base(node, context)
 {
     innerPrice = FactoryManager.Build <Price>(node.GetNode("price"), context);
 }
コード例 #9
0
 protected WrappedReward(RawNode rawNode, IContext context)
     : base(rawNode, context)
 {
     innerReward = FactoryManager.Build <Reward>(rawNode.GetNode("reward"), context);
 }
コード例 #10
0
 public RenewableResourceReward(RawNode node, IContext context)
     : base(node, context)
 {
     _amount = FactoryManager.Build <Amount>(node.GetNode("amount"), context);
 }
コード例 #11
0
 public override void Initialization()
 {
     reward = FactoryManager.Build <Reward>(node.GetNode("reward"), GetContext());
 }
コード例 #12
0
 public SimpleResourceReward(RawNode node, IContext context = null) : base(node, context)
 {
     amount = FactoryManager.Build <Amount>(node.GetNode("amount"), context);
 }
コード例 #13
0
 public WrappedRewardResult(RawNode node, IContext context) : base(node, context)
 {
     rewardResult = FactoryManager.Build <RewardResult>(node.GetNode("result"), context);
 }
コード例 #14
0
 protected override Trigger Factory(RawNode initNode, TriggerDescription description)
 {
     return((Trigger)FactoryManager.Build(typeof(Trigger), description.type, initNode, categories, description, GetContext()));
 }
コード例 #15
0
 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);
 }