+++ /dev/null
-#include "component.h"
-
-namespace Msp::Game {
-
-Component::Component(Handle<Entity> e):
- entity(e)
-{ }
-
-} // namespace Msp::Game
protected:
Handle<Entity> entity;
- Component(Handle<Entity>);
+ Component(Handle<Entity> e): entity(e) { }
public:
virtual ~Component() = default;
namespace Msp::Game {
-EventObserver::EventObserver(EventBus &b):
- bus(b)
-{ }
-
EventObserver::~EventObserver()
{
bus.remove_observer(*this);
std::vector<EventSourceBase *> observed_sources;
public:
- EventObserver(EventBus &);
+ EventObserver(EventBus &b): bus(b) { }
~EventObserver();
template<typename T>
namespace Msp::Game {
-Light::Light(Handle<Entity> e, const Setup &s):
- Component(e),
- setup(s)
-{ }
-
unsigned Light::get_shadow_map_size(unsigned base) const
{
if(setup.shadow_detail<0)
const Setup &setup;
public:
- Light(Handle<Entity>, const Setup &);
+ Light(Handle<Entity> e, const Setup &s): Component(e), setup(s) { }
LightType get_type() const { return setup.type; }
float get_intensity() const { return setup.intensity; }
+++ /dev/null
-#include "meshsource.h"
-
-namespace Msp::Game {
-
-} // namespace Msp::Game
+++ /dev/null
-#include "shadowtarget.h"
-
-namespace Msp::Game {
-
-ShadowTarget::ShadowTarget(Handle<Entity> e, const Setup &setup):
- Component(e),
- radius(setup.radius)
-{ }
-
-} // namespace Msp::Game
float radius;
public:
- ShadowTarget(Handle<Entity>, const Setup &);
+ ShadowTarget(Handle<Entity> e, const Setup &s): Component(e), radius(s.radius) { }
float get_radius() const { return radius; }
};
namespace Msp::Game {
-SystemScheduler::SystemScheduler(Reflection::Reflector &r):
- reflector(r)
-{ }
-
void SystemScheduler::add_system(System &s)
{
nodes.emplace_back(&s, reflector.find_class(typeid(s)));
std::vector<Group> groups;
public:
- SystemScheduler(Reflection::Reflector &);
+ SystemScheduler(Reflection::Reflector &r): reflector(r) { }
void add_system(System &);
void remove_system(System &);
return { p, r, s };
}
-Transform::Transform(Handle<Entity> e):
- BufferedComponent<TransformData>(e)
-{ }
-
void Transform::set_values(const TransformValues &v)
{
write().values = v;
class MSPGAME_API Transform: public BufferedComponent<TransformData>
{
public:
- Transform(Handle<Entity>);
+ Transform(Handle<Entity> e): BufferedComponent(e) { }
void set_values(const TransformValues &);
void set_position(const LinAl::Vector<float, 3> &);
}
+// Hide the Owned destructors from the header
Renderer::RenderedEntity::RenderedEntity(Game::Handle<Game::Entity> e):
entity(e)
{ }
+++ /dev/null
-#include "trackedelement.h"
-
-namespace Msp::GameView {
-
-TrackedElement::TrackedElement(Game::Handle<Game::Entity> p, Role r):
- Component(p),
- role(r)
-{ }
-
-} // namespace Msp::GameView
Role role;
public:
- TrackedElement(Game::Handle<Game::Entity>, Role);
+ TrackedElement(Game::Handle<Game::Entity> e, Role r): Component(e), role(r) { }
Role get_role() const { return role; }
};