GetWall() public method

public GetWall ( short tileX, short tileY, sbyte level ) : FSO.LotView.Model.WallTile
tileX short
tileY short
level sbyte
return FSO.LotView.Model.WallTile
コード例 #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;
            }
        }
コード例 #2
0
        internal void SetWallUse(VMArchitecture arch,bool set)
        {
            var wall = arch.GetWall(Position.TileX,Position.TileY,Position.Level);

            var  placeFlags = (WallPlacementFlags)ObjectData[(int)VMStackObjectVariable.WallPlacementFlags];
            int  rotate     = (8 - (DirectionToWallOff(Direction) + 1)) % 4;
            byte rotPart    = (byte)RotateWallSegs((WallSegments)((int)placeFlags % 15),rotate);

            SetValue(VMStackObjectVariable.WallAdjacencyFlags,(short)RotateWallSegs(wall.Segments,rotate));

            if (rotPart == 0)
            {
                return;
            }

            if (set)
            {
                wall.OccupiedWalls |= (WallSegments)rotPart;
            }
            else
            {
                wall.OccupiedWalls &= (WallSegments) ~rotPart;
            }

            arch.SetWall(Position.TileX,Position.TileY,Position.Level,wall);
        }
コード例 #3
0
ファイル: VMEntity.cs プロジェクト: Daribon/FreeSO
 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;
     }
 }
コード例 #4
0
ファイル: VMEntity.cs プロジェクト: Daribon/FreeSO
        internal void SetWallUse(VMArchitecture arch, bool set)
        {
            var wall = arch.GetWall(Position.TileX, Position.TileY, Position.Level);

            var placeFlags = (WallPlacementFlags)ObjectData[(int)VMStackObjectVariable.WallPlacementFlags];
            int rotate = (8-(DirectionToWallOff(Direction) + 1)) % 4;
            byte rotPart = (byte)RotateWallSegs((WallSegments)((int)placeFlags%15), rotate);

            if (set) wall.OccupiedWalls |= (WallSegments)rotPart;
            else wall.OccupiedWalls &= (WallSegments)~rotPart;

            arch.SetWall(Position.TileX, Position.TileY, Position.Level, wall);
        }
コード例 #5
0
        internal void SetWallUse(VMArchitecture arch, bool set)
        {
            var wall = arch.GetWall(Position.TileX, Position.TileY, Position.Level);

            var placeFlags = (WallPlacementFlags)ObjectData[(int)VMStackObjectVariable.WallPlacementFlags];
            int rotate = (8-(DirectionToWallOff(Direction) + 1)) % 4;
            byte rotPart = (byte)RotateWallSegs((WallSegments)((int)placeFlags%15), rotate);
            SetValue(VMStackObjectVariable.WallAdjacencyFlags, (short)RotateWallSegs(wall.Segments, rotate));

            if (rotPart == 0) return;

            if (UseWorld) ((ObjectComponent)WorldUI).AdjacentWall = (WallSegments)rotPart;

            if (set) wall.OccupiedWalls |= (WallSegments)rotPart;
            else wall.OccupiedWalls &= (WallSegments)~rotPart;

            arch.SetWall(Position.TileX, Position.TileY, Position.Level, wall);
        }