using System.Collections.Generic; using System.Runtime.Remoting.Messaging; using Entitas; using Entitas.CodeGeneration.Attributes; namespace CoreGame.Render { public struct SvrCmd { public int cmdType; public int frame; public int eid; public IMessage msg; public static void CreateCommand(ClientEvent type, out SvrCmd battleCommand, in IMessage msg) { battleCommand = default; battleCommand.eid = BattleModule.s_LocalPlayerEid; battleCommand.cmdType = (int)type; battleCommand.msg = msg; } public void Reset() { } } [Unique, Combat] public class CmdRecvComponent : IComponent { // public Queue renderCmds; // render -> logic 指令 public Queue netCmds; // net -> logic 指令 public CombatEntity ent; // // 渲染层的指令 // public void PushRenderCmd(in ClientCmd cmd) // { // if (renderCmds.Count == 0) // { // ent.ReplaceComponent(CombatComponentsLookup.CmdRecv, this); // } // renderCmds.Enqueue(cmd); // } } }