8#ifndef GALAXY_STATE_SCENE_HPP_
9#define GALAXY_STATE_SCENE_HPP_
11#include <entt/signal/dispatcher.hpp>
26 class Scene :
public fs::Serializable
68 [[nodiscard]]
bool load_world(
const std::string& file);
75 [[nodiscard]] nlohmann::json
serialize()
override;
82 void deserialize(
const nlohmann::json& json)
override;
Wrapper around entt::registry to expand functionality.
map::World m_world
LDTK world.
virtual void load()
When scene is loaded and made active.
Scene()=delete
Constructor.
const std::string & name() const noexcept
Get scene name.
virtual ~Scene()
Destructor.
virtual void render()
Render scene.
virtual void update()
Process events and updates.
int m_position_iterations
Box2d world position iterations.
graphics::Camera m_camera
Camera.
std::string m_name
Scene name for debug purposes.
nlohmann::json serialize() override
Serializes object.
entt::dispatcher m_dispatcher
Scene event handler.
b2World m_b2world
Box2D physics world.
core::Registry m_registry
Entity data.
bool load_world(const std::string &file)
Loads an LDTK world for this scene.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
int m_velocity_iterations
Box2D world velocity iterations.
virtual void unload()
When scene is deactivated / unloaded.