コード例 #1
0
        public static StructureBoundingBox Func_35051_a(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par5);
            StructureComponent   structurecomponent   = StructureComponent.FindIntersecting(par0List, structureboundingbox);

            if (structurecomponent == null)
            {
                return(null);
            }

            if (structurecomponent.GetBoundingBox().MinY == structureboundingbox.MinY)
            {
                for (int i = 3; i >= 1; i--)
                {
                    StructureBoundingBox structureboundingbox1 = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i - 1, par5);

                    if (!structurecomponent.GetBoundingBox().IntersectsWith(structureboundingbox1))
                    {
                        return(StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i, par5));
                    }
                }
            }

            return(null);
        }
コード例 #2
0
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4);
            int i = par1Random.Next(3) + 2;

            do
            {
                if (i <= 0)
                {
                    break;
                }

                int j = i * 5;

                switch (par5)
                {
                case 2:
                    structureboundingbox.MaxX = par2 + 2;
                    structureboundingbox.MinZ = par4 - (j - 1);
                    break;

                case 0:
                    structureboundingbox.MaxX = par2 + 2;
                    structureboundingbox.MaxZ = par4 + (j - 1);
                    break;

                case 1:
                    structureboundingbox.MinX = par2 - (j - 1);
                    structureboundingbox.MaxZ = par4 + 2;
                    break;

                case 3:
                    structureboundingbox.MaxX = par2 + (j - 1);
                    structureboundingbox.MaxZ = par4 + 2;
                    break;
                }

                if (StructureComponent.FindIntersecting(par0List, structureboundingbox) == null)
                {
                    break;
                }

                i--;
            }while (true);

            if (i > 0)
            {
                return(structureboundingbox);
            }
            else
            {
                return(null);
            }
        }
        public static ComponentStrongholdStairsStraight FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 8, par5);

            if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentStrongholdStairsStraight(par6, par1Random, structureboundingbox, par5));
            }
        }
コード例 #4
0
        /// <summary>
        /// Creates and returns a new component piece. Or null if it could not find enough room to place it.
        /// </summary>
        public static ComponentNetherBridgeCrossing2 CreateValidComponent(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5);

            if (!IsAboveGround(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentNetherBridgeCrossing2(par6, par1Random, structureboundingbox, par5));
            }
        }
コード例 #5
0
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static ComponentVillageChurch FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 5, 12, 9, par5);

            if (!CanVillageGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentVillageChurch(par6, par1Random, structureboundingbox, par5));
            }
        }
コード例 #6
0
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 3, 4, 2, par5);

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }
コード例 #7
0
        public static ComponentNetherBridgeEnd Func_40023_a(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5);

            if (!IsAboveGround(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentNetherBridgeEnd(par6, par1Random, structureboundingbox, par5));
            }
        }
コード例 #8
0
        public static ComponentVillageHouse4_Garden FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 5, 6, 5, par5);

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentVillageHouse4_Garden(par6, par1Random, structureboundingbox, par5));
            }
        }
コード例 #9
0
        public static StructureBoundingBox Func_35087_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6)
        {
            for (int i = 7 * MathHelper2.GetRandomIntegerInRange(par2Random, 3, 5); i >= 7; i -= 7)
            {
                StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 3, i, par6);

                if (StructureComponent.FindIntersecting(par1List, structureboundingbox) == null)
                {
                    return(structureboundingbox);
                }
            }

            return(null);
        }
コード例 #10
0
        public static ComponentStrongholdLibrary FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 11, 15, par5);

            if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 6, 15, par5);

                if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
                {
                    return(null);
                }
            }

            return(new ComponentStrongholdLibrary(par6, par1Random, structureboundingbox, par5));
        }
コード例 #11
0
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4);

            if (par1Random.Next(4) == 0)
            {
                structureboundingbox.MaxY += 4;
            }

            switch (par5)
            {
            case 2:
                structureboundingbox.MinX = par2 - 1;
                structureboundingbox.MaxX = par2 + 3;
                structureboundingbox.MinZ = par4 - 4;
                break;

            case 0:
                structureboundingbox.MinX = par2 - 1;
                structureboundingbox.MaxX = par2 + 3;
                structureboundingbox.MaxZ = par4 + 4;
                break;

            case 1:
                structureboundingbox.MinX = par2 - 4;
                structureboundingbox.MinZ = par4 - 1;
                structureboundingbox.MaxZ = par4 + 3;
                break;

            case 3:
                structureboundingbox.MaxX = par2 + 4;
                structureboundingbox.MinZ = par4 - 1;
                structureboundingbox.MaxZ = par4 + 3;
                break;
            }

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }
コード例 #12
0
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3 - 5, par4, par2, par3 + 2, par4);

            switch (par5)
            {
            case 2:
                structureboundingbox.MaxX = par2 + 2;
                structureboundingbox.MinZ = par4 - 8;
                break;

            case 0:
                structureboundingbox.MaxX = par2 + 2;
                structureboundingbox.MaxZ = par4 + 8;
                break;

            case 1:
                structureboundingbox.MinX = par2 - 8;
                structureboundingbox.MaxZ = par4 + 2;
                break;

            case 3:
                structureboundingbox.MaxX = par2 + 8;
                structureboundingbox.MaxZ = par4 + 2;
                break;
            }

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }