Example #1
0
        public bool                                     Overlaps(BiomeSurfaceSwitch b2)
        {
            bool slopeOverlaps  = (!slopeEnabled || !b2.slopeEnabled) || (slopeEnabled && b2.slopeEnabled && PWUtils.Overlap(minSlope, maxSlope, b2.minSlope, b2.maxSlope));
            bool heightOverlaps = (!heightEnabled || !b2.heightEnabled) || (heightEnabled && b2.heightEnabled && PWUtils.Overlap(minHeight, maxHeight, b2.minHeight, b2.maxHeight));
            bool paramOverlaps  = (!paramEnabled || !b2.paramEnabled) || (paramEnabled && b2.paramEnabled && PWUtils.Overlap(minParam, maxParam, b2.minParam, b2.maxParam));

            return(slopeOverlaps && heightOverlaps && paramOverlaps);
        }
Example #2
0
        public float                            GapWidth(BiomeSurfaceSwitch b2)
        {
            float gap = 0;

            if (heightEnabled)
            {
                gap += PWUtils.GapWidth(minHeight, maxHeight, b2.minHeight, b2.maxHeight);
            }
            if (slopeEnabled)
            {
                gap += PWUtils.GapWidth(minSlope, maxSlope, b2.minSlope, b2.maxSlope);
            }
            if (paramEnabled)
            {
                gap += PWUtils.GapWidth(minParam, maxParam, b2.minParam, b2.maxParam);
            }

            return(gap);
        }