public bool CanRemoveGrid(ConcealedGrid concealed) {
            if (!Grids.ContainsKey(concealed.EntityId)) {
                Log.Error("Failed to find in list " + concealed.EntityId,
                    "RemoveGrid");
                return false;
            }

            return true;
        }
Exemplo n.º 2
0
        public bool QueueReveal(ConcealedGrid grid)
        {
            if (!grid.IsRevealable)
            {
                Log.Warning("Is not revealable: " + grid.EntityId, "QueueReveal");
                return(false);
            }

            Log.Trace("Equeuing grid for reveal " + grid.EntityId, "QueueReveal");
            GridRevealQueue.Enqueue(grid);
            return(true);
        }
Exemplo n.º 3
0
        public bool QueueReveal(long entityId)
        {
            ConcealedGrid grid = Concealed.GetGrid(entityId);

            if (grid == null)
            {
                Log.Error("Couldn't find grid to reveal " + entityId, "QueueReveal");
                return(false);
            }

            return(QueueReveal(grid));
        }
        public bool AddGrid(ConcealedGrid concealed) {
            // Track it
            if (Grids.ContainsKey(concealed.EntityId)) {
                Log.Error("Attempting to store already-stored entity id " +
                    concealed.EntityId, "ConcealGrid");
                return false;
            }

            Grids.Add(concealed.EntityId, concealed);
            //GridBuilders.Add(concealed.EntityId, concealed.Builder);
            GridTree.Add(concealed);

            NeedsSave = true;
            return true;
        }
        public static ConcealedGridsResponse FromBytes(byte[] bytes)
        {
            VRage.ByteStream       stream   = new VRage.ByteStream(bytes, bytes.Length);
            ConcealedGridsResponse response = new ConcealedGridsResponse();

            response.LoadFromByteStream(stream);

            ConcealedGrid grid;
            ushort        count = stream.getUShort();

            for (int i = 0; i < count; i++)
            {
                grid = new ConcealedGrid(stream);
                response.ConcealedGrids.Add(grid);
            }

            return(response);
        }
 public void RemoveGrid(ConcealedGrid concealed) {
     Grids.Remove(concealed.EntityId);
     GridTree.Remove(concealed);
     NeedsSave = true;
 }