2024-08-17 14:27:18 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using DotRecast.Core.Collections;
|
|
|
|
|
using Game.JNGFrame.Logic.Entity;
|
|
|
|
|
using Game.JNGFrame.Logic.Entity.Contexts;
|
2024-08-31 21:05:29 +08:00
|
|
|
|
using Game.Logic.Entity.Nodes;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
using JNGame.Sync.State.Tile.Entity;
|
|
|
|
|
using JNGame.Sync.System;
|
|
|
|
|
using JNGame.Sync.System.Data;
|
|
|
|
|
|
|
|
|
|
namespace Game.JNGState.Logic.Data
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public class EDPlayerValue : GDataValue
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
|
|
|
|
public int? Auth = null;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public class EDPlayerData : GDataBase<EDPlayerData,EDPlayerValue,EDPlayer>
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
2024-08-31 15:35:12 +08:00
|
|
|
|
public override void BindEntity(JNTileEntity entity)
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
2024-08-31 15:35:12 +08:00
|
|
|
|
base.BindEntity(entity);
|
|
|
|
|
Value.Auth = Node.Controller.Auth;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool IsEquals(ISData data)
|
|
|
|
|
{
|
|
|
|
|
var node = data as EDPlayerData;
|
|
|
|
|
if (node is null) return false;
|
2024-08-22 20:37:39 +08:00
|
|
|
|
return base.IsEquals(data) && Value.Auth.Equals(node.Value.Auth);
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public override EDPlayerValue GetDifference(ISData diffValue = null)
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
|
|
|
|
var diff = diffValue as EDPlayerData;
|
2024-08-22 20:37:39 +08:00
|
|
|
|
var value = base.GetDifference(diffValue);
|
|
|
|
|
if (value is null || diff is null) return null;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
|
|
|
|
|
if (diff.Value.Auth is not null) value.Auth = diff.Value.Auth;
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
return value;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public override void UData(EDPlayerValue data)
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
2024-08-22 20:37:39 +08:00
|
|
|
|
base.UData(data);
|
|
|
|
|
if (data.Auth is not null) Value.Auth = data.Auth;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-22 20:37:39 +08:00
|
|
|
|
|
|
|
|
|
|
2024-08-31 15:35:12 +08:00
|
|
|
|
public class EDPlayerDataSystem : GDataBaseSystem<EDPlayerData,EDPlayerValue,EDPlayer>
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public EDPlayerDataSystem(SStateDataEnum type) : base(type)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int NetID => (int)NetDataEnum.EDPlayerData;
|
|
|
|
|
|
|
|
|
|
public override JNTileContext<EDPlayer> NodeContext => Contexts.GetContext<EDPlayerContext>();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|