/// <summary> /// 读取字节流(完整版) /// </summary> protected override void toReadBytesFull(BytesReadStream stream) { stream.startReadObj(); this.funcID = stream.readInt(); this.matchTime = stream.readLong(); BaseData locationT = stream.readDataFullNotNull(); if (locationT != null) { if (locationT is SceneLocationData) { this.location = (SceneLocationData)locationT; } else { this.location = new SceneLocationData(); if (!(locationT.GetType().IsAssignableFrom(typeof(SceneLocationData)))) { stream.throwTypeReadError(typeof(SceneLocationData), locationT.GetType()); } this.location.shadowCopy(locationT); } } else { this.location = null; } stream.endReadObj(); }
/// <summary> /// 改变 /// </summary> public virtual void onChange(RoleShowChangeData data) { switch (data.type) { case RoleShowDataPartType.IsOnline: { this.isOnline = (data.arg0 == 1); //同时赋值两个 this.lastOnlineTime = data.arg2; } break; case RoleShowDataPartType.LastOnlineTime: { this.lastOnlineTime = data.arg2; } break; case RoleShowDataPartType.Location: { this.location = ((SceneLocationRoleShowChangeData)data).localtion; } break; default: { //传递 showData.onChange(data); } break; } }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { if (!(data is RoleSocialData)) { return; } RoleSocialData mData = (RoleSocialData)data; if (mData.showData != null) { this.showData = (RoleShowData)mData.showData.clone(); } else { this.showData = null; nullObjError("showData"); } this.isOnline = mData.isOnline; this.lastOnlineTime = mData.lastOnlineTime; if (mData.location != null) { this.location = (SceneLocationData)mData.location.clone(); } else { this.location = null; } }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.showData = null; this.isOnline = false; this.lastOnlineTime = 0L; this.location = null; }
/// <summary> /// 是否数据一致 /// </summary> protected override bool toDataEquals(BaseData data) { SceneLocationData mData = (SceneLocationData)data; if (this.sceneID != mData.sceneID) { return(false); } if (this.lineID != mData.lineID) { return(false); } if (this.serverID != mData.serverID) { return(false); } if (this.executorIndex != mData.executorIndex) { return(false); } if (this.instanceID != mData.instanceID) { return(false); } return(true); }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.funcID = stream.readInt(); this.matchTime = stream.readLong(); this.location = (SceneLocationData)stream.readDataSimpleNotNull(); }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.location = (SceneLocationData)stream.readDataSimpleNotNull(); this.posID = stream.readInt(); this.useCache = stream.readBoolean(); }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is SceneEnterArgData)) { return; } SceneEnterArgData mData = (SceneEnterArgData)data; this.location = mData.location; this.posID = mData.posID; this.useCache = mData.useCache; }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { base.toReadBytesSimple(stream); if (stream.readBoolean()) { this.localtion = (SceneLocationData)stream.readDataSimpleNotNull(); } else { this.localtion = null; } }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { base.toShadowCopy(data); if (!(data is SceneLocationRoleShowChangeData)) { return; } SceneLocationRoleShowChangeData mData = (SceneLocationRoleShowChangeData)data; this.localtion = mData.localtion; }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is MatchSceneData)) { return; } MatchSceneData mData = (MatchSceneData)data; this.funcID = mData.funcID; this.matchTime = mData.matchTime; this.location = mData.location; }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is RoleSocialData)) { return; } RoleSocialData mData = (RoleSocialData)data; this.showData = mData.showData; this.isOnline = mData.isOnline; this.lastOnlineTime = mData.lastOnlineTime; this.location = mData.location; }
/// <summary> /// 复制(潜拷贝) /// </summary> protected override void toShadowCopy(BaseData data) { if (!(data is SceneLocationData)) { return; } SceneLocationData mData = (SceneLocationData)data; this.sceneID = mData.sceneID; this.lineID = mData.lineID; this.serverID = mData.serverID; this.executorIndex = mData.executorIndex; this.instanceID = mData.instanceID; }
/// <summary> /// 读取字节流(简版) /// </summary> protected override void toReadBytesSimple(BytesReadStream stream) { this.showData = (RoleShowData)stream.readDataSimpleNotNull(); this.isOnline = stream.readBoolean(); this.lastOnlineTime = stream.readLong(); if (stream.readBoolean()) { this.location = (SceneLocationData)stream.readDataSimpleNotNull(); } else { this.location = null; } }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { base.toCopy(data); if (!(data is SceneLocationRoleShowChangeData)) { return; } SceneLocationRoleShowChangeData mData = (SceneLocationRoleShowChangeData)data; if (mData.localtion != null) { this.localtion = (SceneLocationData)mData.localtion.clone(); } else { this.localtion = null; } }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { if (!(data is SceneEnterArgData)) { return; } SceneEnterArgData mData = (SceneEnterArgData)data; if (mData.location != null) { this.location = (SceneLocationData)mData.location.clone(); } else { this.location = null; nullObjError("location"); } this.posID = mData.posID; this.useCache = mData.useCache; }
/// <summary> /// 复制(深拷贝) /// </summary> protected override void toCopy(BaseData data) { if (!(data is MatchSceneData)) { return; } MatchSceneData mData = (MatchSceneData)data; this.funcID = mData.funcID; this.matchTime = mData.matchTime; if (mData.location != null) { this.location = (SceneLocationData)mData.location.clone(); } else { this.location = null; nullObjError("location"); } }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { base.toRelease(pool); this.localtion = null; }
/// <summary> /// 读取字节流(完整版) /// </summary> protected override void toReadBytesFull(BytesReadStream stream) { stream.startReadObj(); BaseData showDataT = stream.readDataFullNotNull(); if (showDataT != null) { if (showDataT is RoleShowData) { this.showData = (RoleShowData)showDataT; } else { this.showData = new RoleShowData(); if (!(showDataT.GetType().IsAssignableFrom(typeof(RoleShowData)))) { stream.throwTypeReadError(typeof(RoleShowData), showDataT.GetType()); } this.showData.shadowCopy(showDataT); } } else { this.showData = null; } this.isOnline = stream.readBoolean(); this.lastOnlineTime = stream.readLong(); if (stream.readBoolean()) { BaseData locationT = stream.readDataFullNotNull(); if (locationT != null) { if (locationT is SceneLocationData) { this.location = (SceneLocationData)locationT; } else { this.location = new SceneLocationData(); if (!(locationT.GetType().IsAssignableFrom(typeof(SceneLocationData)))) { stream.throwTypeReadError(typeof(SceneLocationData), locationT.GetType()); } this.location.shadowCopy(locationT); } } else { this.location = null; } } else { this.location = null; } stream.endReadObj(); }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.location = null; this.posID = 0; this.useCache = false; }
/// <summary> /// 回池 /// </summary> protected override void toRelease(DataPool pool) { this.funcID = 0; this.matchTime = 0L; this.location = null; }
/// <summary> /// 初始化初值 /// </summary> public override void initDefault() { this.location = new SceneLocationData(); this.location.initDefault(); }