2024-08-17 14:27:18 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2024-08-22 20:37:39 +08:00
|
|
|
|
using AppGame;
|
2024-08-17 14:27:18 +08:00
|
|
|
|
using DotRecast.Core.Collections;
|
|
|
|
|
using Entitas;
|
|
|
|
|
using Game.JNGFrame.Logic.Entity;
|
|
|
|
|
using Game.JNGFrame.Logic.Entity.Contexts;
|
|
|
|
|
using JNGame.Math;
|
|
|
|
|
using JNGame.Sync.State.Tile.Entity;
|
|
|
|
|
using JNGame.Sync.System;
|
|
|
|
|
using JNGame.Sync.System.Data;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Game.JNGState.Logic.Data
|
|
|
|
|
{
|
2024-08-22 20:37:39 +08:00
|
|
|
|
|
2024-08-17 14:27:18 +08:00
|
|
|
|
[Serializable]
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public class EDNodeValue : GDataValue
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
2024-08-22 20:37:39 +08:00
|
|
|
|
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public class EDNodeData : GDataBase<EDNodeData,EDNodeValue,EDNode>
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
2024-08-22 20:37:39 +08:00
|
|
|
|
|
2024-08-17 14:27:18 +08:00
|
|
|
|
public EDNodeData()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public EDNodeData(EDNode node) : base(node)
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2024-08-22 20:37:39 +08:00
|
|
|
|
|
2024-08-17 14:27:18 +08:00
|
|
|
|
}
|
2024-08-22 20:37:39 +08:00
|
|
|
|
public class EDNodeDataSystem : GDataBaseSystem<EDNodeData,EDNode>
|
2024-08-17 14:27:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public EDNodeDataSystem(SStateDataEnum type) : base(type)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override JNTileContext<EDNode> NodeContext => Contexts.GetContext<EDNodeContext>();
|
|
|
|
|
|
|
|
|
|
public override int NetID => (int)NetDataEnum.EDNodeData;
|
|
|
|
|
|
|
|
|
|
public override Dictionary<long, EDNodeData> GetLatest()
|
|
|
|
|
{
|
|
|
|
|
var nodes = new Dictionary<long, EDNodeData>();
|
|
|
|
|
NodeContext.GetEntities().ForEach(child =>
|
|
|
|
|
{
|
2024-08-21 16:18:52 +08:00
|
|
|
|
if (nodes.ContainsKey(child.Id))
|
|
|
|
|
{
|
|
|
|
|
Debug.Log($"[EDNodeDataSystem] 出错 发现重复Key");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-08-17 14:27:18 +08:00
|
|
|
|
nodes.Add(child.Id,new EDNodeData(child));
|
|
|
|
|
});
|
|
|
|
|
return nodes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|