40 lines
922 B
C++
40 lines
922 B
C++
#pragma once
|
|
|
|
#include "object.hpp"
|
|
|
|
#include <cstdlib>
|
|
|
|
namespace game {
|
|
class Planet : public Object {
|
|
public:
|
|
/**
|
|
* 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
|
|
};
|
|
|
|
Planet(const glm::vec2 &pos, int id, float r) : Planet(pos, id, r, Material::Rock)
|
|
{
|
|
}
|
|
|
|
Planet(const glm::vec2 &pos, int id, float r, Material mat)
|
|
: Object(pos, r)
|
|
, id(id)
|
|
, material(mat)
|
|
, seed(rand())
|
|
{
|
|
}
|
|
|
|
int id;
|
|
Material material; // for rendering and physics (can fly through sun and outer gas planets)
|
|
int seed; // just for rendering variation
|
|
};
|
|
}
|