-
Notifications
You must be signed in to change notification settings - Fork 0
/
Universe.h
49 lines (40 loc) · 1.05 KB
/
Universe.h
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
#ifndef UNIVERSE_H
#define UNIVERSE_H
#include "UniverseInterface.h"
#include "UniverseParameters.hpp"
#include "StarCategory.h"
#include "StarInterface.h"
#include "StarInfo.h"
#include "PerlinNoise.hpp"
#include <vector>
class Universe : public UniverseInterface {
public:
void GetStars(const double & centerX, const double & centerY, const double & distance, StarCollectionType & stars);
void Save();
void Load();
private:
enum ExtentIndexEnum {
eiSize = 0,
eiBaseX = 1,
eiBaseY = 2,
eiMAX = 3,
};
int32_t extent_indexes_[2 * eiMAX];
public:
Universe();
~Universe();
UniverseParameters * GetParameters() {
return &m_params;
}
private:
void UpdateCategoryIndex();
int GetCategoryIndex(double value);
bool GenerateStarAt(const double & x, const double & y, StarInfo * p);
private:
siv::PerlinNoise * m_noise;
StarCollectionType m_stars;
// Input parameters
UniverseParameters m_params;
// Force star generation after parameter update
};
#endif // UNIVERSE_H