ToArray() public méthode

public ToArray ( ) : Server.StaticTile[]
Résultat Server.StaticTile[]
Exemple #1
0
        public Tile[] GetStaticTiles(int x, int y, bool multis)
        {
            if (!multis)
            {
                return(GetStaticTiles(x, y));
            }

            Tile[][][] tiles = GetStaticBlock(x >> 3, y >> 3);

            var eable = m_Owner.GetMultiTilesAt(x, y);

            if (!eable.Any())
            {
                return(Season.PatchTiles(tiles[x & 0x7][y & 0x7], m_Owner.Season));
            }

            foreach (Tile[] multiTiles in eable)
            {
                m_TilesList.AddRange(multiTiles);
            }

            m_TilesList.AddRange(Season.PatchTiles(tiles[x & 0x7][y & 0x7], m_Owner.Season));

            return(m_TilesList.ToArray());
        }
Exemple #2
0
        public StaticTile[] GetStaticTiles(int x, int y, bool multis)
        {
            StaticTile[][][] tiles = GetStaticBlock(x >> 3, y >> 3);

            if (!multis)
            {
                return(tiles[x & 0x7][y & 0x7]);
            }

            IPooledEnumerable <StaticTile[]> eable = m_Owner.GetMultiTilesAt(x, y);

            if (eable == Map.NullEnumerable <StaticTile[]> .Instance)
            {
                return(tiles[x & 0x7][y & 0x7]);
            }

            bool any = false;

            m_TilesList.AddRange(eable.SelectMany(t => { any = true; return(t); }).ToArray());

            eable.Free();

            if (!any)
            {
                return(tiles[x & 0x7][y & 0x7]);
            }

            m_TilesList.AddRange(tiles[x & 0x7][y & 0x7]);

            return(m_TilesList.ToArray());
        }
Exemple #3
0
        public StaticTile[] GetStaticTiles(int x, int y, bool multis)
        {
            StaticTile[][][] tiles = GetStaticBlock(x >> 3, y >> 3);

            if (multis)
            {
                IPooledEnumerable <StaticTile[]> eable = m_Owner.GetMultiTilesAt(x, y);

                if (eable == Map.NullEnumerable <StaticTile[]> .Instance)
                {
                    return(tiles[x & 0x7][y & 0x7]);
                }

                bool any = false;

                foreach (StaticTile[] multiTiles in eable)
                {
                    if (!any)
                    {
                        any = true;
                    }

                    m_TilesList.AddRange(multiTiles);
                }

                eable.Free();

                if (!any)
                {
                    return(tiles[x & 0x7][y & 0x7]);
                }

                m_TilesList.AddRange(tiles[x & 0x7][y & 0x7]);

                return(m_TilesList.ToArray());
            }
            else
            {
                return(tiles[x & 0x7][y & 0x7]);
            }
        }