예제 #1
0
        /// <summary>
        /// Indicates if a given tile is "solid".
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="isPlatformSolid"></param>
        /// <param name="isActuatedSolid"></param>
        /// <returns></returns>
        public static bool IsSolid(Tile tile, bool isPlatformSolid = false, bool isActuatedSolid = false)
        {
            if (TileHelpers.IsAir(tile))
            {
                return(false);
            }
            if (!Main.tileSolid[tile.type] || !tile.active())
            {
                return(false);
            }

            if (!isPlatformSolid)
            {
                bool isTopSolid = Main.tileSolidTop[tile.type];
                if (isTopSolid)
                {
                    return(false);
                }
            }

            if (!isActuatedSolid)
            {
                bool isPassable = tile.inActive();
                if (isPassable)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Indicates if a given tile is "air" (including no walls).
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="isWireAir"></param>
        /// <param name="isLiquidAir"></param>
        /// <returns></returns>
        public static bool IsAir(Tile tile, bool isWireAir = false, bool isLiquidAir = false)
        {
            if (tile == null)
            {
                return(true);
            }
            if (tile.active() || tile.wall > 0)               /*|| tile.type == 0*/
            {
                return(false);
            }
            if (!isWireAir && TileHelpers.IsWire(tile))
            {
                return(false);
            }
            if (!isLiquidAir && tile.liquid != 0)
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        /// <summary>
        /// Indicates if a given tile cannot be destroyed by vanilla explosives.
        /// </summary>
        /// <param name="tileX"></param>
        /// <param name="tileY"></param>
        /// <returns></returns>
        public static bool IsNotVanillaBombable(int tileX, int tileY)
        {
            Tile tile = Framing.GetTileSafely(tileX, tileY);

            return(!TileLoader.CanExplode(tileX, tileY) || TileHelpers.IsNotVanillaBombableType(tile.type));
        }