KlassischeKeplerKriege/game/state/planet.hpp

41 lines
922 B
C++
Raw Normal View History

#pragma once
#include "object.hpp"
2016-09-27 21:29:26 +00:00
#include <cstdlib>
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 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
};
}