public PlainRandomWorldGenerator(
            WorldSizeRelativeValue fromYRV,
            WorldSizeRelativeValue toYRV,
            TileTypeProbability[] originalProbabilities)
        {
            this.fromYRV = fromYRV;
            this.toYRV = toYRV;

            List<TileTypeProbability> probs = new List<TileTypeProbability>();

            probs.AddRange(originalProbabilities);

            probs.Sort(SortByProbability);

            probabilityRange = 0;
            foreach (TileTypeProbability p in probs)
                probabilityRange += p.probability;

            for (int i = 1; i < probs.Count; i++)
            {
                TileTypeProbability p = probs[i];
                p.probability += probs[i - 1].probability;
                probs[i] = p;
            }

            this.probabilities = probs.ToArray();
        }
        public PlainRandomWorldGenerator(
            WorldSizeRelativeValue fromYRV,
            WorldSizeRelativeValue toYRV,
            TileTypeProbability[] originalProbabilities)
        {
            this.fromYRV = fromYRV;
            this.toYRV   = toYRV;

            List <TileTypeProbability> probs = new List <TileTypeProbability>();

            probs.AddRange(originalProbabilities);

            probs.Sort(SortByProbability);

            probabilityRange = 0;
            foreach (TileTypeProbability p in probs)
            {
                probabilityRange += p.probability;
            }

            for (int i = 1; i < probs.Count; i++)
            {
                TileTypeProbability p = probs[i];
                p.probability += probs[i - 1].probability;
                probs[i]       = p;
            }

            this.probabilities = probs.ToArray();
        }
示例#3
0
        public TreeWorldGenerator(
            WorldSizeRelativeValue minRV,
            WorldSizeRelativeValue maxRV,
            int minTrunkHeight,
            int maxTrunkHeight,
            int minLeavesHeight,
            int maxLeavesHeight,
            int minLeavesRadius,
            int maxLeavesRadius,
            byte overTileType,
            byte tileTypeTrunk,
            byte tileTypeLeaves)
        {
            this.minRV = minRV;
            this.maxRV = maxRV;

            this.minTrunkHeight  = minTrunkHeight;
            this.maxTrunkHeight  = maxTrunkHeight;
            this.minLeavesHeight = minLeavesHeight;
            this.maxLeavesHeight = maxLeavesHeight;
            this.minLeavesRadius = minLeavesRadius;
            this.maxLeavesRadius = maxLeavesRadius;

            this.overTileType   = overTileType;
            this.tileTypeLeaves = tileTypeLeaves;
            this.tileTypeTrunk  = tileTypeTrunk;
        }
        public TreeWorldGenerator(
            WorldSizeRelativeValue minRV,
            WorldSizeRelativeValue maxRV, 
            int minTrunkHeight,
            int maxTrunkHeight,
            int minLeavesHeight,
            int maxLeavesHeight,
            int minLeavesRadius,
            int maxLeavesRadius,
            byte overTileType, 
            byte tileTypeTrunk, 
            byte tileTypeLeaves)
        {
            this.minRV = minRV;
            this.maxRV = maxRV;

            this.minTrunkHeight = minTrunkHeight;
            this.maxTrunkHeight = maxTrunkHeight;
            this.minLeavesHeight = minLeavesHeight;
            this.maxLeavesHeight = maxLeavesHeight;
            this.minLeavesRadius = minLeavesRadius;
            this.maxLeavesRadius = maxLeavesRadius;

            this.overTileType = overTileType;
            this.tileTypeLeaves = tileTypeLeaves;
            this.tileTypeTrunk = tileTypeTrunk;
        }
 public WaterWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     byte waterTileType)
 {
     this.fromYRV = fromYRV;
     this.toYRV = toYRV;
     this.waterTileType = waterTileType;
 }
示例#6
0
 public PlainWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     byte tileType)
 {
     this.fromYRV  = fromYRV;
     this.toYRV    = toYRV;
     this.tileType = tileType;
 }
示例#7
0
 public WaterWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     byte waterTileType)
 {
     this.fromYRV       = fromYRV;
     this.toYRV         = toYRV;
     this.waterTileType = waterTileType;
 }
 public PlainWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV, 
     byte tileType)
 {
     this.fromYRV = fromYRV;
     this.toYRV = toYRV;
     this.tileType = tileType;
 }
 public SmoothWorldGenerator(
     byte tileType,
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV)
 {
     this.tileType = tileType;
     this.iterationsRV = iterationsRV;
     this.minRadiusRV = minRadiusRV;
     this.maxRadiusRV = maxRadiusRV;
 }
 public MidpointDisplacementWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     float roughness,
     byte tileType)
 {
     this.fromYRV   = fromYRV;
     this.toYRV     = toYRV;
     this.roughness = roughness;
     this.tileType  = tileType;
 }
示例#11
0
 public SmoothWorldGenerator(
     byte tileType,
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV)
 {
     this.tileType     = tileType;
     this.iterationsRV = iterationsRV;
     this.minRadiusRV  = minRadiusRV;
     this.maxRadiusRV  = maxRadiusRV;
 }
        public MidpointDisplacementWorldGenerator(
            WorldSizeRelativeValue fromYRV,
            WorldSizeRelativeValue toYRV,
            float roughness,
			byte tileType)
        {
            this.fromYRV = fromYRV;
            this.toYRV = toYRV;
            this.roughness = roughness;
            this.tileType = tileType;
        }
示例#13
0
 public HoleWorldGenerator(
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV,
     WorldSizeRelativeValue minDepthRV,
     WorldSizeRelativeValue maxDepthRV)
 {
     this.iterationsRV = iterationsRV;
     this.minRadiusRV = minRadiusRV;
     this.maxRadiusRV = maxRadiusRV;
     this.minDepthRV = minDepthRV;
     this.maxDepthRV = maxDepthRV;
 }
示例#14
0
 public CaveWorldGenerator(
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV,
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV)
 {
     this.iterationsRV = iterationsRV;
     this.minRadiusRV  = minRadiusRV;
     this.maxRadiusRV  = maxRadiusRV;
     this.fromYRV      = fromYRV;
     this.toYRV        = toYRV;
 }
示例#15
0
 public PerlinNoise2WorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     int octaves,
     float freq,
     byte tileType)
 {
     this.fromYRV  = fromYRV;
     this.toYRV    = toYRV;
     this.tileType = tileType;
     this.octaves  = octaves;
     this.freq     = freq;
 }
示例#16
0
 public HoleWorldGenerator(
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV,
     WorldSizeRelativeValue minDepthRV,
     WorldSizeRelativeValue maxDepthRV)
 {
     this.iterationsRV = iterationsRV;
     this.minRadiusRV  = minRadiusRV;
     this.maxRadiusRV  = maxRadiusRV;
     this.minDepthRV   = minDepthRV;
     this.maxDepthRV   = maxDepthRV;
 }
示例#17
0
 public CaveWorldGenerator(
     WorldSizeRelativeValue iterationsRV, 
     WorldSizeRelativeValue minRadiusRV, 
     WorldSizeRelativeValue maxRadiusRV, 
     WorldSizeRelativeValue fromYRV, 
     WorldSizeRelativeValue toYRV)
 {
     this.iterationsRV = iterationsRV;
     this.minRadiusRV = minRadiusRV;
     this.maxRadiusRV = maxRadiusRV;
     this.fromYRV = fromYRV;
     this.toYRV = toYRV;
 }
        public PerlinNoise2WorldGenerator(
			WorldSizeRelativeValue fromYRV,
            WorldSizeRelativeValue toYRV,
			int octaves,
			float freq,
			byte tileType)
        {
            this.fromYRV = fromYRV;
            this.toYRV = toYRV;
            this.tileType = tileType;
			this.octaves = octaves;
			this.freq = freq;
        }
        public ParticleDepositionWorldGenerator(
            WorldSizeRelativeValue minParticlesRV,
            WorldSizeRelativeValue maxParticlesRV,
            WorldSizeRelativeValue minDropsRV,
            WorldSizeRelativeValue maxDropsRV, 
            byte tileType)
        {
            this.minParticlesRV = minParticlesRV;
            this.maxParticlesRV = maxParticlesRV;
            this.minDropsRV = minDropsRV;
            this.maxDropsRV = maxDropsRV;
            this.tileType = tileType;

            nearPositions = new int[3][];
            nearPositions[0] = new int[3];
            nearPositions[1] = new int[3];
            nearPositions[2] = new int[3];
        }
示例#20
0
        public ParticleDepositionWorldGenerator(
            WorldSizeRelativeValue minParticlesRV,
            WorldSizeRelativeValue maxParticlesRV,
            WorldSizeRelativeValue minDropsRV,
            WorldSizeRelativeValue maxDropsRV,
            byte tileType)
        {
            this.minParticlesRV = minParticlesRV;
            this.maxParticlesRV = maxParticlesRV;
            this.minDropsRV     = minDropsRV;
            this.maxDropsRV     = maxDropsRV;
            this.tileType       = tileType;

            nearPositions    = new int[3][];
            nearPositions[0] = new int[3];
            nearPositions[1] = new int[3];
            nearPositions[2] = new int[3];
        }
示例#21
0
 public DepositWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV,
     byte overTile,
     byte tileType,
     bool allowEmptyAbove)
 {
     this.fromYRV         = fromYRV;
     this.toYRV           = toYRV;
     this.iterationsRV    = iterationsRV;
     this.minRadiusRV     = minRadiusRV;
     this.maxRadiusRV     = maxRadiusRV;
     this.overTile        = overTile;
     this.tileType        = tileType;
     this.allowEmptyAbove = allowEmptyAbove;
 }
 public DepositWorldGenerator(
     WorldSizeRelativeValue fromYRV,
     WorldSizeRelativeValue toYRV,
     WorldSizeRelativeValue iterationsRV,
     WorldSizeRelativeValue minRadiusRV,
     WorldSizeRelativeValue maxRadiusRV,
     byte overTile,
     byte tileType,
     bool allowEmptyAbove)
 {
     this.fromYRV = fromYRV;
     this.toYRV = toYRV;
     this.iterationsRV = iterationsRV;
     this.minRadiusRV = minRadiusRV;
     this.maxRadiusRV = maxRadiusRV;
     this.overTile = overTile;
     this.tileType = tileType;
     this.allowEmptyAbove = allowEmptyAbove;
 }
示例#23
0
 public void Load(BinaryReader br)
 {
     surroundingMaterial = br.ReadInt32();
     surroundingLevel = SerializationUtils.ReadWorldSizeRelativeValue(br);
     surroundingOffsetY = br.ReadSingle();
 }
示例#24
0
 public static void Write(BinaryWriter bw, WorldSizeRelativeValue wsRelativeValue)
 {
     bw.Write(wsRelativeValue.Expression);
 }