예제 #1
0
        protected Block()
        {
            Left   = new BlockFaceEdge();
            Right  = new BlockFaceEdge();
            Top    = new BlockFaceEdge();
            Bottom = new BlockFaceEdge();
            Lid    = new BlockFaceLid();

            Coors = new List <VertexPositionNormalTexture>();
            IndexBufferCollection = new List <int>();
        }
예제 #2
0
파일: Block.cs 프로젝트: spritefun/gta2net
 protected Block(BlockStructure blockStructure, Vector3 pos)
 {
     BlockStructure = blockStructure;
     Left = new BlockFaceEdge(blockStructure.Left);
     Right = new BlockFaceEdge(blockStructure.Right);
     Top = new BlockFaceEdge(blockStructure.Top);
     Bottom = new BlockFaceEdge(blockStructure.Bottom);
     Lid = new BlockFaceLid(blockStructure.Lid);
     Arrows = (RoadTrafficType) blockStructure.Arrows;
     ParseSlope(blockStructure.SlopeType);
     Position = pos;
     Coors = new List<VertexPositionNormalTexture>();
     IndexBufferCollection = new List<int>();
     Left.FixTileWallCollision();
     Right.FixTileWallCollision();
     Top.FixTileWallCollision();
     Bottom.FixTileWallCollision();
 }
예제 #3
0
파일: Block.cs 프로젝트: spritefun/gta2net
 protected Block(BlockStructure blockStructure, Vector3 pos)
 {
     BlockStructure = blockStructure;
     Left           = new BlockFaceEdge(blockStructure.Left);
     Right          = new BlockFaceEdge(blockStructure.Right);
     Top            = new BlockFaceEdge(blockStructure.Top);
     Bottom         = new BlockFaceEdge(blockStructure.Bottom);
     Lid            = new BlockFaceLid(blockStructure.Lid);
     Arrows         = (RoadTrafficType)blockStructure.Arrows;
     ParseSlope(blockStructure.SlopeType);
     Position = pos;
     Coors    = new List <VertexPositionNormalTexture>();
     IndexBufferCollection = new List <int>();
     Left.FixTileWallCollision();
     Right.FixTileWallCollision();
     Top.FixTileWallCollision();
     Bottom.FixTileWallCollision();
 }
예제 #4
0
        public static void FixTileWallCollision(this BlockFaceEdge blockFace)
        {
            if (blockFace.TileNumber == 0)
            {
                return;
            }
            TileWallCollisionFix tileWallCollisionFix;
            var add = false;

            if (!TileWallCollisionFixes.TryGetValue(blockFace.TileNumber, out tileWallCollisionFix))
            {
                tileWallCollisionFix = new TileWallCollisionFix();
                add = true;
            }
            if (blockFace.Wall)
            {
                if (blockFace.BulletWall)
                {
                    tileWallCollisionFix.CollisionCount++;
                }
                else
                {
                    tileWallCollisionFix.NoBulletCollision++;
                }
                if (tileWallCollisionFix.NoCollisionCount > 0 && !MismatchTiles.Contains(blockFace.TileNumber))
                {
                    MismatchTiles.Add(blockFace.TileNumber);
                }
            }
            else
            {
                tileWallCollisionFix.NoCollisionCount++;
                if (tileWallCollisionFix.CollisionCount > 0 && !MismatchTiles.Contains(blockFace.TileNumber))
                {
                    MismatchTiles.Add(blockFace.TileNumber);
                }
            }
            tileWallCollisionFix.TileNumber = blockFace.TileNumber;
            tileWallCollisionFix.BlockFaces.Add(blockFace);
            if (add)
            {
                TileWallCollisionFixes.Add(blockFace.TileNumber, tileWallCollisionFix);
            }
        }
예제 #5
0
파일: Block.cs 프로젝트: jpires/gta2net
 protected virtual bool DoesWallCollide(BlockFaceEdge blockFace, bool bulletWall)
 {
     return blockFace && (bulletWall ? blockFace.BulletWall : blockFace.Wall);
 }
예제 #6
0
파일: Block.cs 프로젝트: jpires/gta2net
        protected Block()
        {
            Left = new BlockFaceEdge();
            Right = new BlockFaceEdge();
            Top = new BlockFaceEdge();
            Bottom = new BlockFaceEdge();
            Lid = new BlockFaceLid();

            Coors = new List<VertexPositionNormalTexture>();
            IndexBufferCollection = new List<int>();
        }
예제 #7
0
파일: Block.cs 프로젝트: spritefun/gta2net
 protected virtual bool DoesWallCollide(BlockFaceEdge blockFace, bool bulletWall)
 {
     return(blockFace && (bulletWall ? blockFace.BulletWall : blockFace.Wall));
 }