From ecfae286064b4a8fcf6e4df38c09e8055e83de33 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Aug 2014 11:40:33 +0200 Subject: Changed cStructGenOreNests to take a list of ores + the block to replace. --- src/Generating/StructGen.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/Generating/StructGen.h') diff --git a/src/Generating/StructGen.h b/src/Generating/StructGen.h index 9176bc192..e2fe8bc1a 100644 --- a/src/Generating/StructGen.h +++ b/src/Generating/StructGen.h @@ -76,11 +76,29 @@ class cStructGenOreNests : public cFinishGen { public: - cStructGenOreNests(int a_Seed) : m_Noise(a_Seed), m_Seed(a_Seed) {} - + struct OreInfo + { + BLOCKTYPE BlockType; // The type of the nest. + int MaxHeight; // The highest possible a nest can occur + int NumNests; // How many nests per chunk + int NestSize; // The amount of blocks a nest can have. + }; + + typedef std::vector OreList; + + cStructGenOreNests(int a_Seed, OreList a_OreList, BLOCKTYPE a_ToReplace) : + m_Noise(a_Seed), + m_Seed(a_Seed), + m_OreList(a_OreList), + m_ToReplace(a_ToReplace) + {} + protected: - cNoise m_Noise; - int m_Seed; + cNoise m_Noise; + int m_Seed; + + OreList m_OreList; // A list of possible ores. + BLOCKTYPE m_ToReplace; // cFinishGen override: virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; -- cgit v1.2.3 From d95768d01a93a14df38f6e0e33ca180b779c5df0 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Aug 2014 22:36:02 +0200 Subject: Bunch of tweaks: Renamed Quarts to Quartz Using const_iterator instead of iterator Used CheckBasicStyle script to find style errors --- src/Generating/StructGen.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Generating/StructGen.h') diff --git a/src/Generating/StructGen.h b/src/Generating/StructGen.h index e2fe8bc1a..55d5bc1c7 100644 --- a/src/Generating/StructGen.h +++ b/src/Generating/StructGen.h @@ -78,16 +78,16 @@ class cStructGenOreNests : public: struct OreInfo { - BLOCKTYPE BlockType; // The type of the nest. - int MaxHeight; // The highest possible a nest can occur - int NumNests; // How many nests per chunk - int NestSize; // The amount of blocks a nest can have. + BLOCKTYPE BlockType; // The type of the nest. + int MaxHeight; // The highest possible a nest can occur + int NumNests; // How many nests per chunk + int NestSize; // The amount of blocks a nest can have. }; typedef std::vector OreList; - cStructGenOreNests(int a_Seed, OreList a_OreList, BLOCKTYPE a_ToReplace) : - m_Noise(a_Seed), + cStructGenOreNests(int a_Seed, OreList a_OreList, BLOCKTYPE a_ToReplace) : + m_Noise(a_Seed), m_Seed(a_Seed), m_OreList(a_OreList), m_ToReplace(a_ToReplace) @@ -97,7 +97,7 @@ protected: cNoise m_Noise; int m_Seed; - OreList m_OreList; // A list of possible ores. + OreList m_OreList; // A list of possible ores. BLOCKTYPE m_ToReplace; // cFinishGen override: -- cgit v1.2.3