Ejemplo n.º 1
0
        private void generateRandomBuildingDimensions(
            uint maxWidth, uint maxHeight)
        {
            uint height = 0, width = 0;

            height = Math.Max(minBuildingLength, Math.Min((uint)Math.Ceiling(
                                                              random.Beta(2.5d, 4.0d) * maxHeight), maxHeight - minBuildingLength));
            float scaling = 1.0f / (1.0f - (float)(height / maxWidth));

            width = Math.Max(minBuildingLength, Math.Min((uint)Math.Ceiling(
                                                             random.Beta(6.0d, 6.0d * scaling) * maxWidth), maxWidth -
                                                         minBuildingLength));
            this.buildingWidth  = width;
            this.buildingHeight = height;
        }