//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace cfg
{
public sealed partial class RankRobot : Bright.Config.BeanBase
{
public JSONNode json;
public RankRobot(JSONNode _json)
{
{ if(!_json["ID"].IsNumber) { throw new SerializationException(); } ID = _json["ID"]; }
{ var __json0 = _json["FillerRank"]; if(!__json0.IsArray) { throw new SerializationException(); } FillerRank = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } FillerRank.Add(__v0); } }
{ if(!_json["MaxPoint"].IsNumber) { throw new SerializationException(); } MaxPoint = _json["MaxPoint"]; }
{ if(!_json["OriginPoint"].IsNumber) { throw new SerializationException(); } OriginPoint = _json["OriginPoint"]; }
{ var __json0 = _json["PointAddedPerInterval"]; if(!__json0.IsArray) { throw new SerializationException(); } PointAddedPerInterval = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } PointAddedPerInterval.Add(__v0); } }
{ var __json0 = _json["PointAddedProb"]; if(!__json0.IsArray) { throw new SerializationException(); } PointAddedProb = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { float __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } PointAddedProb.Add(__v0); } }
{ if(!_json["PointAddedMultiple"].IsNumber) { throw new SerializationException(); } PointAddedMultiple = _json["PointAddedMultiple"]; }
{ if(!_json["RandomRange"].IsNumber) { throw new SerializationException(); } RandomRange = _json["RandomRange"]; }
json = _json;
PostInit();
}
public RankRobot(int ID, System.Collections.Generic.List FillerRank, int MaxPoint, int OriginPoint, System.Collections.Generic.List PointAddedPerInterval, System.Collections.Generic.List PointAddedProb, int PointAddedMultiple, float RandomRange )
{
this.ID = ID;
this.FillerRank = FillerRank;
this.MaxPoint = MaxPoint;
this.OriginPoint = OriginPoint;
this.PointAddedPerInterval = PointAddedPerInterval;
this.PointAddedProb = PointAddedProb;
this.PointAddedMultiple = PointAddedMultiple;
this.RandomRange = RandomRange;
PostInit();
}
public static RankRobot DeserializeRankRobot(JSONNode _json)
{
return new RankRobot(_json);
}
public int ID { get; private set; }
///
/// 计算自身积分时,取最高排名的玩家分数和最低排名的分数的均值
///
public System.Collections.Generic.List FillerRank { get; private set; }
public int MaxPoint { get; private set; }
public int OriginPoint { get; private set; }
///
/// 随时间衰减
///
public System.Collections.Generic.List PointAddedPerInterval { get; private set; }
///
/// 随时间衰减
///
public System.Collections.Generic.List PointAddedProb { get; private set; }
///
/// 加的分必须是这个数的倍数
///
public int PointAddedMultiple { get; private set; }
///
/// 40%代表(1 - 40%/2) 到 (1 + 40%/2)之间
初始积分、每次间隔加分时用
///
public float RandomRange { get; private set; }
public const int __ID__ = 1350109566;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
PostResolve();
}
public void TranslateText(System.Func translator)
{
}
public override string ToString()
{
return "{ "
+ "ID:" + ID + ","
+ "FillerRank:" + Bright.Common.StringUtil.CollectionToString(FillerRank) + ","
+ "MaxPoint:" + MaxPoint + ","
+ "OriginPoint:" + OriginPoint + ","
+ "PointAddedPerInterval:" + Bright.Common.StringUtil.CollectionToString(PointAddedPerInterval) + ","
+ "PointAddedProb:" + Bright.Common.StringUtil.CollectionToString(PointAddedProb) + ","
+ "PointAddedMultiple:" + PointAddedMultiple + ","
+ "RandomRange:" + RandomRange + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}