Example #1
0
    public TerrainCellData UnrenderCell(int id)
    {
        if (cellsData.ContainsKey(id))
        {
            return(cellsData[id]);
        }

        if (!cells.ContainsKey(id))
        {
            return(null);
        }

        TerrainCell     cell     = cells[id];
        TerrainCellData cellData = cell.GetData();

        foreach (Actor actor in ActorsAtCoords(cell.coords))
        {
            UnrenderActor(actor.id);
        }

        foreach (Item item in ItemsAtCoords(cell.coords))
        {
            UnrenderItem(item.id);
        }

        cells.Remove(id);
        cell.QueueFree();

        cellsData.Add(id, cellData);
        return(cellData);
    }