summaryrefslogtreecommitdiffstats
path: root/source/BioGen.h
blob: b44d8fdf46d2aef716156538368764a146e621f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

// BioGen.h

/*
Interfaces to the various biome generators:
	- cBioGenConstant
	- cBioGenCheckerboard
	- cBioGenDistortedVoronoi
*/





#pragma once

#include "cChunkGenerator.h"





class cBioGenConstant :
	public cBiomeGen
{
public:
	cBioGenConstant(EMCSBiome a_Biome) : m_Biome(a_Biome) {}
	
protected:

	EMCSBiome m_Biome;

	// cBiomeGen override:
	virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
} ;





class cBioGenDistortedVoronoi :
	public cBiomeGen
{
public:
	cBioGenDistortedVoronoi(int a_Seed) : m_Seed(a_Seed) {}

protected:

	int m_Seed;

	// cBiomeGen override:
	virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
} ;





class cBioGenCheckerboard :
	public cBiomeGen
{
public:
	cBioGenCheckerboard(int a_BiomeSize, const AString & a_Biomes) :
		m_BiomeSize((a_BiomeSize < 8) ? 8 : a_BiomeSize)
	{
		InitializeBiomes(a_Biomes);
	}
	
protected:

	int m_BiomeSize;
	
	// List of biomes that the generator is allowed to generate:
	typedef std::vector<EMCSBiome> EMCSBiomes;
	EMCSBiomes m_Biomes;
	int        m_BiomesCount;
	
	void InitializeBiomes(const AString & a_Biomes);
	
	// cBiomeGen override:
	virtual void GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override;
} ;