1 #ifndef CORE_SYSTEMS_SCRIPTS_HPP
2 #define CORE_SYSTEMS_SCRIPTS_HPP
4 #include <BLIB/Events.hpp>
5 #include <BLIB/Scripts.hpp>
6 #include <BLIB/Serialization/JSON.hpp>
8 #include <unordered_map>
22 class Scripts :
public bl::event::Listener<event::GameSaveInitializing> {
43 const bl::script::Value*
getEntry(
const std::string& name)
const;
51 void setEntry(
const std::string& name,
const bl::script::Value& val);
55 std::unordered_map<std::string, bl::script::Value> entries;
59 friend struct bl::serial::SerializableObject<
Scripts>;
Core classes and functionality for both the editor and game.
Fired when the game is saving or loading. Allows systems to hook in their data.
System that stores and handles saving/loading of save entries for scripts.
const bl::script::Value * getEntry(const std::string &name) const
Returns the save entry with the given name. May be null if not found.
void setEntry(const std::string &name, const bl::script::Value &val)
Sets a save entry.
void init()
Subscribes to the game event bus.
Scripts(Systems &owner)
Initializes the scripting system.
Owns all primary systems and a reference to the engine.