2016-09-27 16:23:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "object.hpp"
|
|
|
|
|
2016-09-27 21:29:26 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
|
2016-09-27 16:23:58 +00:00
|
|
|
namespace game {
|
|
|
|
class Planet : public Object {
|
|
|
|
public:
|
2016-09-27 21:29:26 +00:00
|
|
|
/**
|
|
|
|
* Planets are build out of one material.
|
|
|
|
* TODO: support mixture or multiple material per planet.
|
|
|
|
*/
|
|
|
|
enum class Material {
|
|
|
|
Rock,
|
|
|
|
Metal,
|
|
|
|
Sand,
|
|
|
|
Gas,
|
|
|
|
Ice,
|
|
|
|
Water,
|
|
|
|
Sun
|
|
|
|
};
|
|
|
|
|
2016-09-27 22:13:03 +00:00
|
|
|
Planet(const glm::vec2 &pos, int id, float r) : Planet(pos, id, r, Material::Rock)
|
2016-09-27 21:29:26 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-09-27 22:13:03 +00:00
|
|
|
Planet(const glm::vec2 &pos, int id, float r, Material mat)
|
2016-09-27 21:29:26 +00:00
|
|
|
: Object(pos, r)
|
2016-09-27 22:13:03 +00:00
|
|
|
, id(id)
|
2016-09-27 21:29:26 +00:00
|
|
|
, material(mat)
|
|
|
|
, seed(rand())
|
2016-09-27 16:23:58 +00:00
|
|
|
{
|
|
|
|
}
|
2016-09-27 21:29:26 +00:00
|
|
|
|
2016-09-27 22:13:03 +00:00
|
|
|
int id;
|
|
|
|
Material material; // for rendering and physics (can fly through sun and outer gas planets)
|
|
|
|
int seed; // just for rendering variation
|
2016-09-27 16:23:58 +00:00
|
|
|
};
|
|
|
|
}
|