定义游戏活动需要投入的资源描述
Ejemplo n.º 1
0
        protected override void Initialize(GameRulesBase rules, JObject data)
        {
            base.Initialize(rules, data);

            Constraint  = rules.CreateConstraint((JObject)data["Constraint"]);
            Requirement = ActionInvestmentDescriptor.FromData((JObject)data["Requirement"]);
            Returns     = ActionReturnsDescriptor.FromData((JObject)data["Returns"]);


            if (data.Value <string>("Name") == null)
            {
                _name = DefaultName();
            }
            else
            {
                _name = data.Value <string>("Name");
            }



            if (data.Value <string>("Description") == null)
            {
                _description = DefaultDescription();
            }
            else
            {
                _description = data.Value <string>("Description");
            }
        }
Ejemplo n.º 2
0
        protected override void Initialize( GameRulesBase rules, JObject data )
        {
            base.Initialize( rules, data );

              Constraint = rules.CreateConstraint( (JObject) data["Constraint"] );
              Requirement = ActionInvestmentDescriptor.FromData( (JObject) data["Requirement"] );
              Returns = ActionReturnsDescriptor.FromData( (JObject) data["Returns"] );

              if ( data.Value<string>( "Name" ) == null )
            _name = DefaultName();
              else
            _name = data.Value<string>( "Name" );

              if ( data.Value<string>( "Description" ) == null )
            _description = DefaultDescription();
              else
            _description = data.Value<string>( "Description" );
        }