the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 153 lines 3.7 kB view raw
1#pragma once 2using namespace std; 3 4#include "LevelSource.h" 5#include "Mob.h" 6#include "WeighedRandom.h" 7 8class Feature; 9class MobCategory; 10class BiomeDecorator; 11class TreeFeature; 12class BasicTree; 13class BirchFeature; 14class SwampTreeFeature; 15class ChunkRebuildData; 16 17class Biome 18{ 19 friend class ChunkRebuildData; 20public: 21 // 4J JEV, replaces the static blocks. 22 static void staticCtor(); 23 24 static Biome *biomes[256]; 25 26 static Biome *ocean; 27 static Biome *plains; 28 static Biome *desert; 29 static Biome *extremeHills; 30 static Biome *forest; 31 static Biome *taiga; 32 static Biome *swampland; 33 static Biome *river; 34 static Biome *hell; 35 static Biome *sky; 36 static Biome *frozenOcean; 37 static Biome *frozenRiver; 38 static Biome *iceFlats; 39 static Biome *iceMountains; 40 static Biome *mushroomIsland; 41 static Biome *mushroomIslandShore ; 42 static Biome *beaches; 43 static Biome *desertHills; 44 static Biome *forestHills; 45 static Biome *taigaHills; 46 static Biome *smallerExtremeHills; 47 static Biome *jungle; 48 static Biome *jungleHills; 49 50 static const int BIOME_COUNT = 23; // 4J Stu added 51 52public: 53 wstring m_name; 54 int color; 55 byte topMaterial; 56 byte material; 57 int leafColor; 58 float depth; 59 float scale; 60 float temperature; 61 float downfall; 62 //int waterColor; // 4J Stu removed 63 64 BiomeDecorator *decorator; 65 66 const int id; 67 68 class MobSpawnerData : public WeighedRandomItem 69 { 70 public: 71 eINSTANCEOF mobClass; 72 int minCount; 73 int maxCount; 74 75 MobSpawnerData(eINSTANCEOF mobClass, int probabilityWeight, int minCount, int maxCount) : WeighedRandomItem(probabilityWeight) 76 { 77 this->mobClass = mobClass; 78 this->minCount = minCount; 79 this->maxCount = maxCount; 80 } 81 }; 82 83protected: 84 vector<MobSpawnerData *> enemies; 85 vector<MobSpawnerData *> friendlies; 86 vector<MobSpawnerData *> waterFriendlies; 87 vector<MobSpawnerData *> friendlies_chicken; 88 vector<MobSpawnerData *> friendlies_wolf; 89 vector<MobSpawnerData *> friendlies_mushroomcow; 90 vector<MobSpawnerData *> ambientFriendlies; 91 92 Biome(int id); 93 ~Biome(); 94 95 BiomeDecorator *createDecorator(); 96 97private: 98 Biome *setTemperatureAndDownfall(float temp, float downfall); 99 Biome *setDepthAndScale(float depth, float scale); 100 101 bool snowCovered; 102 bool _hasRain; 103 104 // 4J Added 105 eMinecraftColour m_grassColor; 106 eMinecraftColour m_foliageColor; 107 eMinecraftColour m_waterColor; 108 eMinecraftColour m_skyColor; 109 110 Biome *setNoRain(); 111 112protected: 113 /* removing these so that we can consistently return newly created trees via getTreeFeature, and let the calling function be resposible for deleting the returned tree 114 TreeFeature *normalTree; 115 BasicTree *fancyTree; 116 BirchFeature *birchTree; 117 SwampTreeFeature *swampTree; 118 */ 119 120public: 121 virtual Feature *getTreeFeature(Random *random); 122 virtual Feature *getGrassFeature(Random *random); 123 124protected: 125 Biome *setSnowCovered(); 126 Biome *setName(const wstring &name); 127 Biome *setLeafColor(int leafColor); 128 Biome *setColor(int color); 129 130 // 4J Added 131 Biome *setLeafFoliageWaterSkyColor(eMinecraftColour grassColor, eMinecraftColour foliageColor, eMinecraftColour waterColour, eMinecraftColour skyColour); 132 133public: 134 virtual int getSkyColor(float temp); 135 136 vector<MobSpawnerData *> *getMobs(MobCategory *category); 137 138 virtual bool hasSnow(); 139 virtual bool hasRain(); 140 virtual bool isHumid(); 141 142 virtual float getCreatureProbability(); 143 virtual int getDownfallInt(); 144 virtual int getTemperatureInt(); 145 virtual float getDownfall(); // 4J - brought forward from 1.2.3 146 virtual float getTemperature(); // 4J - brought forward from 1.2.3 147 148 virtual void decorate(Level *level, Random *random, int xo, int zo); 149 150 virtual int getGrassColor(); 151 virtual int getFolageColor(); 152 virtual int getWaterColor(); // 4J Added 153};