FSO.SimAntics.VMArchitecture.SetWall C# (CSharp) Method

SetWall() public method

public SetWall ( short tileX, short tileY, sbyte level, FSO.LotView.Model.WallTile wall ) : void
tileX short
tileY short
level sbyte
wall FSO.LotView.Model.WallTile
return void
        public void SetWall(short tileX, short tileY, sbyte level, WallTile wall)
        {
            var off = GetOffset(tileX, tileY);

            WallsAt[level-1].Remove(off);
            if (wall.Segments > 0) {
                Walls[level - 1][off] = wall;
                WallsAt[level - 1].Add(off);
            }
            else
            {
                Walls[level - 1][off] = new WallTile();
            }

            if (RealMode) WallsDirty = true;
            Redraw = true;
        }

Usage Example

Ejemplo n.º 1
0
        internal void SetWallStyle(int side,VMArchitecture arch,ushort value)
        {
            //0=top right, 1=bottom right, 2=bottom left, 3 = top left
            WallTile targ;

            switch (side)
            {
            case 0:
                targ = arch.GetWall(Position.TileX,Position.TileY,Position.Level);
                targ.ObjSetTRStyle = value;
                if (((VMEntityFlags2)ObjectData[(int)VMStackObjectVariable.FlagField2] & VMEntityFlags2.ArchitectualDoor) > 0)
                {
                    targ.TopRightDoor = value != 0;
                }
                arch.SetWall(Position.TileX,Position.TileY,Position.Level,targ);
                break;

            case 1:
                //this seems to be the rule... only set if wall is top left/right. Fixes multitile windows (like really long ones)
                return;

            case 2:
                return;

            case 3:
                targ = arch.GetWall(Position.TileX,Position.TileY,Position.Level);
                targ.ObjSetTLStyle = value;
                if (((VMEntityFlags2)ObjectData[(int)VMStackObjectVariable.FlagField2] & VMEntityFlags2.ArchitectualDoor) > 0)
                {
                    targ.TopLeftDoor = value != 0;
                }
                arch.SetWall(Position.TileX,Position.TileY,Position.Level,targ);
                break;
            }
        }
All Usage Examples Of FSO.SimAntics.VMArchitecture::SetWall