// // scene.hpp // engine // // Created by Sam Jaffe on 9/2/16. // #pragma once #include #include #include #include "game/math/math_fwd.hpp" #include "game/util/identity.hpp" #include "vector/vector.hpp" #include "engine_fwd.hpp" namespace graphics { class renderer; } namespace engine { class entity; class scene : public identity { public: using identity::identity; virtual ~scene(); virtual void update(float delta); virtual void render(); virtual void handle_key_event(event::key_event evt); virtual void handle_mouse_event(event::mouse_event evt); math::vec2 size() const; key_binding const & keys() const; protected: void change_scene(std::string const & scene_id); protected: graphics::renderer * renderer; std::vector entities; // Map from entity::collides_with -> [entity*] std::unordered_map> colliders; // Map from entity::collides_as -> [entity*] std::unordered_map> collidables; private: math::vec2 local_scene_dimension_; key_binding keys_; std::weak_ptr dispatch_; }; }