//------------------------------------------------------------------------------
//
// 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 FishingEvent : Bright.Config.BeanBase
{
public JSONNode json;
public FishingEvent(JSONNode _json)
{
{ if(!_json["ID"].IsNumber) { throw new SerializationException(); } ID = _json["ID"]; }
{ if(!_json["Type"].IsNumber) { throw new SerializationException(); } Type = _json["Type"]; }
{ if(!_json["SubType"].IsNumber) { throw new SerializationException(); } SubType = _json["SubType"]; }
{ if(!_json["RedirectID"].IsNumber) { throw new SerializationException(); } RedirectID = _json["RedirectID"]; }
{ if(!_json["IsABTest"].IsBoolean) { throw new SerializationException(); } IsABTest = _json["IsABTest"]; }
{ if(!_json["TimeDefinition"].IsObject) { throw new SerializationException(); } TimeDefinition = FishingEventType.DeserializeFishingEventType(_json["TimeDefinition"]); }
{ if(!_json["ConditionRelation"].IsNumber) { throw new SerializationException(); } ConditionRelation = _json["ConditionRelation"]; }
{ var __json0 = _json["ConditionList"]; if(!__json0.IsArray) { throw new SerializationException(); } ConditionList = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { EventCondition __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = EventCondition.DeserializeEventCondition(__e0); } ConditionList.Add(__v0); } }
{ if(!_json["FaceID"].IsNumber) { throw new SerializationException(); } FaceID = _json["FaceID"]; }
json = _json;
PostInit();
}
public FishingEvent(int ID, int Type, int SubType, int RedirectID, bool IsABTest, FishingEventType TimeDefinition, int ConditionRelation, System.Collections.Generic.List ConditionList, int FaceID )
{
this.ID = ID;
this.Type = Type;
this.SubType = SubType;
this.RedirectID = RedirectID;
this.IsABTest = IsABTest;
this.TimeDefinition = TimeDefinition;
this.ConditionRelation = ConditionRelation;
this.ConditionList = ConditionList;
this.FaceID = FaceID;
PostInit();
}
public static FishingEvent DeserializeFishingEvent(JSONNode _json)
{
return new FishingEvent(_json);
}
///
/// #备注行
///
public int ID { get; private set; }
///
/// 见附录
///
public int Type { get; private set; }
///
/// 见附录
///
public int SubType { get; private set; }
///
/// 对应表格的编号
///
public int RedirectID { get; private set; }
///
/// 0:否
1:是
是AB Test的不会读取生效
///
public bool IsABTest { get; private set; }
///
/// Forever:永久活动
LimitedTime:限时活动
UserRegistration:用户注册时间
Daily:日活动
Weekly:周活动
///
public FishingEventType TimeDefinition { get; private set; }
///
/// ConditionList填多个时生效
0:或
1:与
///
public int ConditionRelation { get; private set; }
///
/// 见enum表
///
public System.Collections.Generic.List ConditionList { get; private set; }
///
/// 对应拍脸表编号
///
public int FaceID { get; private set; }
public const int __ID__ = 792394320;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
TimeDefinition?.Resolve(_tables);
foreach(var _e in ConditionList) { _e?.Resolve(_tables); }
PostResolve();
}
public void TranslateText(System.Func translator)
{
TimeDefinition?.TranslateText(translator);
foreach(var _e in ConditionList) { _e?.TranslateText(translator); }
}
public override string ToString()
{
return "{ "
+ "ID:" + ID + ","
+ "Type:" + Type + ","
+ "SubType:" + SubType + ","
+ "RedirectID:" + RedirectID + ","
+ "IsABTest:" + IsABTest + ","
+ "TimeDefinition:" + TimeDefinition + ","
+ "ConditionRelation:" + ConditionRelation + ","
+ "ConditionList:" + Bright.Common.StringUtil.CollectionToString(ConditionList) + ","
+ "FaceID:" + FaceID + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}