// read from proto public void FromProto(netproto.EquipPack pdata) { if (pdata.limit != null) { this.limit = ProtoUtil.OptVal(pdata.limit); this.isDirtylimit = true; } for (int i = 0; i < pdata.equips.Count; i++) { var val = pdata.equips[i]; if (val.val == null) { this.equips.Remove(ProtoUtil.OptVal(val.key)); } else { Equip oval; if (!this.equips.TryGetValue(ProtoUtil.OptVal(val.key), out oval)) { oval = new Equip(); oval.FromProto(val.val); this.equips[ProtoUtil.OptVal(val.key)] = oval; } else { oval.FromProto(val.val); } } } this.isDirtyequips = true; }
// read from proto public void FromProto(netproto.Guide pdata) { if (pdata.id != null) { this.id = ProtoUtil.OptVal(pdata.id); this.isDirtyid = true; } }
// read from proto public void FromProto(netproto.TestList pdata) { if (pdata.id != null) { this.id = ProtoUtil.OptVal(pdata.id); this.isDirtyid = true; } for (int i = 0; i < pdata.ListPrimitiveInt.Count; i++) { var val = pdata.ListPrimitiveInt[i]; if (this.ListPrimitiveInt.Count <= val.key) { for (int j = this.ListPrimitiveInt.Count; j <= val.key; j++) { this.ListPrimitiveInt.Add(ProtoUtil.DefVal(ProtoUtil.OptVal(val.val))); } } this.ListPrimitiveInt[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } this.isDirtyListPrimitiveInt = true; for (int i = 0; i < pdata.ListPrimitiveStr.Count; i++) { var val = pdata.ListPrimitiveStr[i]; if (this.ListPrimitiveStr.Count <= val.key) { for (int j = this.ListPrimitiveStr.Count; j <= val.key; j++) { this.ListPrimitiveStr.Add(ProtoUtil.DefVal(ProtoUtil.OptVal(val.val))); } } this.ListPrimitiveStr[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } this.isDirtyListPrimitiveStr = true; for (int i = 0; i < pdata.ListPrimitiveCom.Count; i++) { var val = pdata.ListPrimitiveCom[i]; if (this.ListPrimitiveCom.Count <= val.key) { for (int j = this.ListPrimitiveCom.Count; j <= val.key; j++) { this.ListPrimitiveCom.Add(new PlayerData()); } } if (val.val == null) { this.ListPrimitiveCom[ProtoUtil.OptVal(val.key)] = null; } else { this.ListPrimitiveCom[ProtoUtil.OptVal(val.key)].FromProto(val.val); } } this.isDirtyListPrimitiveCom = true; }
// read from proto public void FromProto(netproto.PlayerInfo pdata) { if (pdata.serverTime != null) { this.serverTime = ProtoUtil.OptVal(pdata.serverTime); this.isDirtyserverTime = true; } if (pdata.serverName != null) { this.serverName = ProtoUtil.OptVal(pdata.serverName); this.isDirtyserverName = true; } }
// read from proto public void FromProto(netproto.Chapter pdata) { for (int i = 0; i < pdata.heros.Count; i++) { var val = pdata.heros[i]; if (this.heros.Count <= val.key) { for (int j = this.heros.Count; j <= val.key; j++) { this.heros.Add(ProtoUtil.DefVal(ProtoUtil.OptVal(val.val))); } } this.heros[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } this.isDirtyheros = true; if (pdata.level != null) { this.level = ProtoUtil.OptVal(pdata.level); this.isDirtylevel = true; } if (pdata.prizeCheckTime != null) { this.prizeCheckTime = ProtoUtil.OptVal(pdata.prizeCheckTime); this.isDirtyprizeCheckTime = true; } for (int i = 0; i < pdata.prizeEquip.Count; i++) { var val = pdata.prizeEquip[i]; if (this.prizeEquip.Count <= val.key) { for (int j = this.prizeEquip.Count; j <= val.key; j++) { this.prizeEquip.Add(new Equip()); } } if (val.val == null) { this.prizeEquip[ProtoUtil.OptVal(val.key)] = null; } else { this.prizeEquip[ProtoUtil.OptVal(val.key)].FromProto(val.val); } } this.isDirtyprizeEquip = true; }
// read from proto public void FromProto(netproto.Daily pdata) { if (pdata.lastUpdateTime != null) { this.lastUpdateTime = ProtoUtil.OptVal(pdata.lastUpdateTime); this.isDirtylastUpdateTime = true; } if (pdata.sign != null) { this.sign = ProtoUtil.OptVal(pdata.sign); this.isDirtysign = true; } if (pdata.totalSign != null) { this.totalSign = ProtoUtil.OptVal(pdata.totalSign); this.isDirtytotalSign = true; } }
// read from proto public void FromProto(netproto.VipInfo pdata) { if (pdata.level != null) { this.level = ProtoUtil.OptVal(pdata.level); this.isDirtylevel = true; } if (pdata.exp != null) { this.exp = ProtoUtil.OptVal(pdata.exp); this.isDirtyexp = true; } if (pdata.totalRecharge != null) { this.totalRecharge = ProtoUtil.OptVal(pdata.totalRecharge); this.isDirtytotalRecharge = true; } }
// read from proto public void FromProto(netproto.Hero pdata) { if (pdata.id != null) { this.id = ProtoUtil.OptVal(pdata.id); this.isDirtyid = true; } if (pdata.level != null) { this.level = ProtoUtil.OptVal(pdata.level); this.isDirtylevel = true; } if (pdata.status != null) { this.status = ProtoUtil.OptVal(pdata.status); this.isDirtystatus = true; } for (int i = 0; i < pdata.equips.Count; i++) { var val = pdata.equips[i]; if (this.equips.Count <= val.key) { for (int j = this.equips.Count; j <= val.key; j++) { this.equips.Add(new Equip()); } } if (val.val == null) { this.equips[ProtoUtil.OptVal(val.key)] = null; } else { this.equips[ProtoUtil.OptVal(val.key)].FromProto(val.val); } } this.isDirtyequips = true; if (pdata.num != null) { this.num = ProtoUtil.OptVal(pdata.num); this.isDirtynum = true; } }
// read from proto public void FromProto(netproto.BaseInfo pdata) { if (pdata.id != null) { this.id = ProtoUtil.OptVal(pdata.id); this.isDirtyid = true; } if (pdata.name != null) { this.name = ProtoUtil.OptVal(pdata.name); this.isDirtyname = true; } if (pdata.level != null) { this.level = ProtoUtil.OptVal(pdata.level); this.isDirtylevel = true; } if (pdata.exp != null) { this.exp = ProtoUtil.OptVal(pdata.exp); this.isDirtyexp = true; } if (pdata.gold != null) { this.gold = ProtoUtil.OptVal(pdata.gold); this.isDirtygold = true; } if (pdata.head != null) { this.head = ProtoUtil.OptVal(pdata.head); this.isDirtyhead = true; } if (pdata.diamond != null) { this.diamond = ProtoUtil.OptVal(pdata.diamond); this.isDirtydiamond = true; } }
// read from proto public void FromProto(netproto.Equip pdata) { if (pdata.id != null) { this.id = ProtoUtil.OptVal(pdata.id); this.isDirtyid = true; } if (pdata.level != null) { this.level = ProtoUtil.OptVal(pdata.level); this.isDirtylevel = true; } if (pdata.status != null) { this.status = ProtoUtil.OptVal(pdata.status); this.isDirtystatus = true; } if (pdata.num != null) { this.num = ProtoUtil.OptVal(pdata.num); this.isDirtynum = true; } }
// read from proto public void FromProto(netproto.TestMap pdata) { if (pdata.id != null) { this.id.FromProto(pdata.id); this.isDirtyid = true; } for (int i = 0; i < pdata.MapPrimitiveIntInt.Count; i++) { var val = pdata.MapPrimitiveIntInt[i]; if (val.val == null) { this.MapPrimitiveIntInt.Remove(ProtoUtil.OptVal(val.key)); } else { this.MapPrimitiveIntInt[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } } this.isDirtyMapPrimitiveIntInt = true; for (int i = 0; i < pdata.MapPrimitiveIntStr.Count; i++) { var val = pdata.MapPrimitiveIntStr[i]; if (val.val == null) { this.MapPrimitiveIntStr.Remove(ProtoUtil.OptVal(val.key)); } else { this.MapPrimitiveIntStr[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } } this.isDirtyMapPrimitiveIntStr = true; for (int i = 0; i < pdata.MapPrimitiveStrInt.Count; i++) { var val = pdata.MapPrimitiveStrInt[i]; if (val.val == null) { this.MapPrimitiveStrInt.Remove(ProtoUtil.OptVal(val.key)); } else { this.MapPrimitiveStrInt[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } } this.isDirtyMapPrimitiveStrInt = true; for (int i = 0; i < pdata.MapPrimitiveStrStr.Count; i++) { var val = pdata.MapPrimitiveStrStr[i]; if (val.val == null) { this.MapPrimitiveStrStr.Remove(ProtoUtil.OptVal(val.key)); } else { this.MapPrimitiveStrStr[ProtoUtil.OptVal(val.key)] = ProtoUtil.OptVal(val.val); } } this.isDirtyMapPrimitiveStrStr = true; for (int i = 0; i < pdata.MapPrimitiveIntCom.Count; i++) { var val = pdata.MapPrimitiveIntCom[i]; if (val.val == null) { this.MapPrimitiveIntCom.Remove(ProtoUtil.OptVal(val.key)); } else { BaseInfo oval; if (!this.MapPrimitiveIntCom.TryGetValue(ProtoUtil.OptVal(val.key), out oval)) { oval = new BaseInfo(); oval.FromProto(val.val); this.MapPrimitiveIntCom[ProtoUtil.OptVal(val.key)] = oval; } else { oval.FromProto(val.val); } } } this.isDirtyMapPrimitiveIntCom = true; for (int i = 0; i < pdata.MapPrimitiveStrCom.Count; i++) { var val = pdata.MapPrimitiveStrCom[i]; if (val.val == null) { this.MapPrimitiveStrCom.Remove(ProtoUtil.OptVal(val.key)); } else { PlayerData oval; if (!this.MapPrimitiveStrCom.TryGetValue(ProtoUtil.OptVal(val.key), out oval)) { oval = new PlayerData(); oval.FromProto(val.val); this.MapPrimitiveStrCom[ProtoUtil.OptVal(val.key)] = oval; } else { oval.FromProto(val.val); } } } this.isDirtyMapPrimitiveStrCom = true; }