#pragma once #include #include #include #include namespace boundard { struct WindowConfig { int width = 800; int height = 600; std::string title = "OpenCGE"; }; struct MeshConfig { std::string shape = "quad"; std::array color{0.5F, 0.5F, 0.5F, 1.0F}; }; struct ActorConfig { std::string name; std::string init_function; std::string tick_function; std::array position{0.0F, 0.0F}; std::array facing{1.0F, 0.0F}; MeshConfig mesh; }; struct InputBindingConfig { std::string action; std::vector keys; std::vector mouse_buttons; }; struct GameConfig { WindowConfig window; std::vector input_bindings; std::vector actors; }; // 从 JSON 加载游戏场景配置(类似 Godot 的场景描述)。 class ConfigLoader { public: bool load(const std::string& path); const GameConfig& config() const; const std::string& last_error() const; private: GameConfig config_; std::string last_error_; }; } // namespace boundard