/// <summary> /// 初始化初值 /// </summary> public override void initDefault() { this.showData = new RoleSimpleShowData(); this.showData.initDefault(); this.chatData = new ChatData(); this.chatData.initDefault(); }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { if (!(data is RoleChatData)) { return; } RoleChatData mData = (RoleChatData)data; if (mData.showData != null) { this.showData = (RoleSimpleShowData)mData.showData.clone(); } else { this.showData = null; nullObjError("showData"); } if (mData.chatData != null) { this.chatData = (ChatData)mData.chatData.clone(); } else { this.chatData = null; nullObjError("chatData"); } this.time = mData.time; this.sendIndex = mData.sendIndex; }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { base.toCopy(data); if (!(data is AuctionSoldLogData)) { return; } AuctionSoldLogData mData = (AuctionSoldLogData)data; if (mData.role != null) { this.role = (RoleSimpleShowData)mData.role.clone(); } else { this.role = null; nullObjError("role"); } if (mData.item != null) { this.item = (ItemData)mData.item.clone(); } else { this.item = null; nullObjError("item"); } this.price = mData.price; }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.showData = null; this.chatData = null; this.time = 0L; this.sendIndex = 0; }
/// <summary> /// 创建角色展示数据 /// </summary> public RoleSimpleShowData createRoleSimpleShowData() { RoleSimpleShowData data = GameC.factory.createRoleSimpleShowData(); makeRoleSimpleShowData(data); return(data); }
/// <summary> /// 是否数据一致 /// </summary> protected override bool toDataEquals(BaseData data) { RoleSimpleShowData mData = (RoleSimpleShowData)data; if (this.playerID != mData.playerID) { return(false); } if (this.createAreaID != mData.createAreaID) { return(false); } if (this.name != mData.name) { return(false); } if (this.sex != mData.sex) { return(false); } if (this.vocation != mData.vocation) { return(false); } return(true); }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { base.toRelease(pool); this.role = null; this.item = null; this.price = 0; }
/// <summary> /// 构造角色简版展示数据 /// </summary> public virtual void makeRoleSimpleShowData(RoleSimpleShowData data) { data.playerID = playerID; data.createAreaID = _d.createAreaID; data.name = _d.name; data.sex = _d.sex; data.vocation = _d.vocation; }
/// <summary> /// 初始化初值 /// </summary> public override void initDefault() { base.initDefault(); this.role = new RoleSimpleShowData(); this.role.initDefault(); this.item = new ItemData(); this.item.initDefault(); }
/// <summary> /// 读取字节流(完整版) /// </summary> protected override void toReadBytesFull(BytesReadStream stream) { base.toReadBytesFull(stream); stream.startReadObj(); BaseData roleT = stream.readDataFullNotNull(); if (roleT != null) { if (roleT is RoleSimpleShowData) { this.role = (RoleSimpleShowData)roleT; } else { this.role = new RoleSimpleShowData(); if (!(roleT.GetType().IsAssignableFrom(typeof(RoleSimpleShowData)))) { stream.throwTypeReadError(typeof(RoleSimpleShowData), roleT.GetType()); } this.role.shadowCopy(roleT); } } else { this.role = null; } BaseData itemT = stream.readDataFullNotNull(); if (itemT != null) { if (itemT is ItemData) { this.item = (ItemData)itemT; } else { this.item = new ItemData(); if (!(itemT.GetType().IsAssignableFrom(typeof(ItemData)))) { stream.throwTypeReadError(typeof(ItemData), itemT.GetType()); } this.item.shadowCopy(itemT); } } else { this.item = null; } this.price = stream.readInt(); stream.endReadObj(); }
/// <summary> /// 读取字节流(完整版) /// </summary> protected override void toReadBytesFull(BytesReadStream stream) { stream.startReadObj(); BaseData showDataT = stream.readDataFullNotNull(); if (showDataT != null) { if (showDataT is RoleSimpleShowData) { this.showData = (RoleSimpleShowData)showDataT; } else { this.showData = new RoleSimpleShowData(); if (!(showDataT.GetType().IsAssignableFrom(typeof(RoleSimpleShowData)))) { stream.throwTypeReadError(typeof(RoleSimpleShowData), showDataT.GetType()); } this.showData.shadowCopy(showDataT); } } else { this.showData = null; } BaseData chatDataT = stream.readDataFullNotNull(); if (chatDataT != null) { if (chatDataT is ChatData) { this.chatData = (ChatData)chatDataT; } else { this.chatData = new ChatData(); if (!(chatDataT.GetType().IsAssignableFrom(typeof(ChatData)))) { stream.throwTypeReadError(typeof(ChatData), chatDataT.GetType()); } this.chatData.shadowCopy(chatDataT); } } else { this.chatData = null; } this.time = stream.readLong(); this.sendIndex = stream.readInt(); stream.endReadObj(); }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { base.toReadBytesSimple(stream); this.role = (RoleSimpleShowData)stream.readDataSimpleNotNull(); this.item = (ItemData)stream.readDataSimpleNotNull(); this.price = stream.readInt(); }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.showData = (RoleSimpleShowData)stream.readDataSimpleNotNull(); this.chatData = (ChatData)stream.readDataSimpleNotNull(); this.time = stream.readLong(); this.sendIndex = stream.readInt(); }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is RoleChatData)) { return; } RoleChatData mData = (RoleChatData)data; this.showData = mData.showData; this.chatData = mData.chatData; this.time = mData.time; this.sendIndex = mData.sendIndex; }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is RoleSimpleShowData)) { return; } RoleSimpleShowData mData = (RoleSimpleShowData)data; this.playerID = mData.playerID; this.createAreaID = mData.createAreaID; this.name = mData.name; this.sex = mData.sex; this.vocation = mData.vocation; }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { base.toShadowCopy(data); if (!(data is AuctionSoldLogData)) { return; } AuctionSoldLogData mData = (AuctionSoldLogData)data; this.role = mData.role; this.item = mData.item; this.price = mData.price; }
public override void makeRoleSimpleShowData(RoleSimpleShowData data) { if (!_g22) { _m22 = instance.Type.GetMethod("makeRoleSimpleShowData", 1); _g22 = true; } if (_m22 != null && !_b22) { _b22 = true; _p1[0] = data; appdomain.Invoke(_m22, instance, _p1); _p1[0] = null; _b22 = false; } else { base.makeRoleSimpleShowData(data); } }