Exemplo n.º 1
0
        /// <summary>
        /// This returns the height of the upper wall part. Returns 0 when no upper part exists.
        /// </summary>

        /*public int GetHighHeight()
         * {
         *      Sidedef other = this.Other;
         *      if(other != null)
         *      {
         *              int top = this.sector.CeilHeight;
         *              int bottom = other.sector.CeilHeight;
         *              int height = top - bottom;
         *              return (height > 0) ? height : 0;
         *      }
         *      else
         *      {
         *              return 0;
         *      }
         * }*/

        /// <summary>
        /// This returns the height of the middle wall part.
        /// </summary>

        /*public int GetMiddleHeight()
         * {
         *      Sidedef other = this.Other;
         *      if(other != null)
         *      {
         *              int top = Math.Min(this.Sector.CeilHeight, other.Sector.CeilHeight);
         *              int bottom = Math.Max(this.Sector.FloorHeight, other.Sector.FloorHeight);
         *              int height = top - bottom;
         *              return (height > 0) ? height : 0;
         *      }
         *      else
         *      {
         *              int top = this.Sector.CeilHeight;
         *              int bottom = this.Sector.FloorHeight;
         *              int height = top - bottom;
         *              return (height > 0) ? height : 0;
         *      }
         * }*/

        /// <summary>
        /// This returns the height of the lower wall part. Returns 0 when no lower part exists.
        /// </summary>

        /*public int GetLowHeight()
         * {
         *      Sidedef other = this.Other;
         *      if(other != null)
         *      {
         *              int top = other.sector.FloorHeight;
         *              int bottom = this.sector.FloorHeight;
         *              int height = top - bottom;
         *              return (height > 0) ? height : 0;
         *      }
         *      else
         *      {
         *              return 0;
         *      }
         * }*/

        // This copies textures to another sidedef
        // And possibly also the offsets
        public void AddTexturesTo(Sidedef s)
        {
            // s cannot be null
            if (s == null)
            {
                return;
            }

            s.BeforePropsChange();
            bool copyoffsets = false;

            //TODO: investigate "masking wall" / "bottoms of invisible walls swapped" wall flags
            // Texture set?
            if (tileindex > 0)
            {
                s.tileindex = tileindex;
                copyoffsets = true;
            }

            // Masked texture set?
            if (maskedtileindex > 0 && s.Other != null)
            {
                s.maskedtileindex = maskedtileindex;
                copyoffsets       = true;
            }

            // Copy offsets?
            if (copyoffsets)
            {
                s.offsetx = offsetx;
                s.offsety = offsety;
            }

            General.Map.IsChanged = true;
        }
Exemplo n.º 2
0
        // This copies all properties to another sidedef
        public void CopyPropertiesTo(Sidedef s)
        {
            s.BeforePropsChange();

            // Copy build properties
            s.flags           = new Dictionary <string, bool>(flags, StringComparer.Ordinal);
            s.offsetx         = offsetx;
            s.offsety         = offsety;
            s.repeatx         = repeatx;
            s.repeaty         = repeaty;
            s.tileindex       = tileindex;
            s.maskedtileindex = maskedtileindex;
            s.shade           = shade;
            s.paletteindex    = paletteindex;

            s.hitag = hitag;
            s.lotag = lotag;
            s.extra = extra;
        }