Example #1
0
        private bool TryGetRoomInfoComponent(int entityId, out RoomInfoComponent com)
        {
            if (_roomInfoEntityMap.TryGet(entityId, out int componentIndex) && componentIndex != Container.EMPTY_ID)
            {
                if (_roomInfoComponents.ContainIndex(componentIndex))
                {
                    com = _roomInfoComponents.Get(componentIndex);
                    return(true);
                }
            }

            com = null;
            return(false);
        }
Example #2
0
        private RoomInfoComponent GetRoomInfoComponentFromPool()
        {
            RoomInfoComponent result;

            if (_roomInfoPool.Count > 0)
            {
                result = _roomInfoPool.Dequeue();
            }
            else
            {
                result = new RoomInfoComponent();
            }

            result.Reset();
            return(result);
        }
Example #3
0
 public void ReleaseRoomInfoComponent(RoomInfoComponent com)
 {
     com.Reset();
     _roomInfoPool.Enqueue(com);
 }