public override void Deserialize(PResourceMapInfo data) { base.Deserialize(data); MapConfigID = data.cfgid; MapPosition = data.mapPos; if (data.simRoleAttr == null) { UserEntityID = 0; UserName = ""; UserLevel = 0; UserPalaceLevel = 0; UserIcon = 0; UserFightScore = -1; } else { UserEntityID = data.simRoleAttr.playerId; UserName = data.simRoleAttr.roleName; UserLevel = data.simRoleAttr.level; UserPalaceLevel = data.simRoleAttr.mainBuildLevel; UserIcon = data.simRoleAttr.headImage; UserFightScore = data.simRoleAttr.fighting; } MapLevel = data.mapLevel; RefreshRemainTime.SetTimeMilliseconds(data.refreshLeftTime); ConquerRemainTime = Utils.GetSeconds(data.occupyLeftTime); ConquerSyncTime = Time.realtimeSinceStartup; ProduceRewardElapseTime = Utils.GetSeconds(data.elapseTime); ProduceRewardSyncTime = Time.realtimeSinceStartup; ProduceValue = data.perHourGain; switch (data.sourceType) { case eSourceMapType.GOLD_OUT: ProduceType = ResourceType.MONEY; break; case eSourceMapType.STONE_OUT: ProduceType = ResourceType.STONE; break; case eSourceMapType.WOOD_OUT: ProduceType = ResourceType.WOOD; break; case eSourceMapType.YUANBAO_OUT: ProduceType = ResourceType.GOLD; break; } foreach (var item in data.heroAttrs) { WorldCityHeroInfo info = new WorldCityHeroInfo(); info.heroCfgID = item.heroCfgId; info.heroLevel = item.level; info.heroQuality = item.jinjie; info.heroStar = item.heroStar; HeroInfoList.Add(info); } }
public virtual void Deserialize(PResourceMapInfo data) { }