public LevelDefine GetLevelByID(int ID, LevelDefine def = default(LevelDefine)) { LevelDefine ret; if (_LevelByID.TryGetValue(ID, out ret)) { return(ret); } if (def == default(LevelDefine)) { TableLogger.ErrorLine("GetLevelByID failed, ID: {0}", ID); } return(def); }
public static void Deserialize(LevelDefine ins, tabtoy.DataReader reader) { int tag = -1; while (-1 != (tag = reader.ReadTag())) { switch (tag) { case 0x10000: { ins.ID = reader.ReadInt32(); } break; case 0x10001: { ins.Time = reader.ReadInt32(); } break; case 0x10002: { ins.TargetScore = reader.ReadInt32(); } break; case 0x60003: { ins.BGM = reader.ReadString(); } break; case 0x60004: { ins.PersonBg = reader.ReadString(); } break; case 0x60005: { ins.MapBg = reader.ReadString(); } break; case 0x60006: { ins.TotalValue = reader.ReadString(); } break; case 0x60007: { ins.Topic = reader.ReadString(); } break; case 0x90008: { ins.ObjPos.Add(reader.ReadStruct <Pos>(PosDeserializeHandler)); } break; } } }