mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
- Introduce Event variant and Overloaded helper for input handling - Move game state (camera, client_world, dev_panel) from App to WorldScene - Add SceneManager with push/pop/change operations for scene stack - Refactor input callbacks to dispatch events through scene hierarchy - Extract Argument struct to separate header - Update Renderer and WorldRenderer to accept world reference - Replace global input state with event-driven processing in ClientPlayer, Camera, etc.
24 lines
578 B
C++
24 lines
578 B
C++
#pragma once
|
|
#include "Cubed/input/event.hpp"
|
|
namespace Cubed {
|
|
class Renderer;
|
|
|
|
enum class SceneType { MAIN_MENU, WORLD };
|
|
|
|
class Scene {
|
|
public:
|
|
Scene() = default;
|
|
|
|
Scene(const Scene&) = delete;
|
|
Scene(Scene&&) = delete;
|
|
Scene& operator=(const Scene&) = delete;
|
|
Scene& operator=(Scene&&) = delete;
|
|
|
|
virtual ~Scene() = default;
|
|
virtual void update(float dt) = 0;
|
|
virtual void render(Renderer& renderer) = 0;
|
|
virtual bool handle_event(const Event& e) = 0;
|
|
virtual void on_enter() {};
|
|
virtual void on_leave() {};
|
|
};
|
|
} // namespace Cubed
|