using System.Collections.Generic; using Entitas; using Entitas.CodeGeneration.Attributes; namespace CoreGame.Render { [Unique, Combat] public class RPCRetryComponent : IComponent { public Dictionary commandCache; public int seq = 0; public void AddCache(int msgId, object msg) { commandCache.Add(seq, new CommandCache { msgId = msgId, seq = seq, time = GameTime.GetRenderTime(), msg = msg }); seq++; } public bool RemoveCache(int seq) { return commandCache.Remove(seq); } } public class CommandCache { public int msgId; public int seq; public float time; public object msg; public override int GetHashCode() { return seq; } } }