コード例 #1
0
        public static string GetTypeAtCell(int cellX, int cellY, int cellZ)
        {
            Layer layer = CurrentMap.Layers[cellZ];

            if (!(layer is TileLayer))
            {
                return("nullType"); // Not an legal Tile Layer
            }

            TileLayer tileLayer = (TileLayer)layer;

            uint GID = tileLayer.GetTileGIDByCell(cellX, cellY);
            int  ID  = TiledHelperMethods.ConvertGIDToID(GID);

            (TiledSet tileSet, uint firstGID) = GetTileSetAndFirstGIDFromID(ID);

            if (tileSet == null)
            {
                return("nullType"); //Should not happen
            }

            return(tileSet.Tiles[ID - (int)firstGID].Type);
        }