Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
database_object.h
1#pragma once
2
3#include "sound_bakery/core/object/object.h"
4
5namespace sbk::core
6{
11 class SB_CLASS database_object : public object
12 {
13 REGISTER_REFLECTION(database_object, object)
14
15 public:
16 sbk_id get_database_id() const;
17 void set_database_id(sbk_id id);
18
19 std::string_view get_database_name() const;
20 void set_database_name(std::string_view name);
21
22 bool get_editor_hidden() const { return editorHidden; }
23 void set_editor_hidden(bool hidden) { editorHidden = hidden; }
24
25 operator sbk_id() const { return m_objectID; }
26
27 [[nodiscard]] MulticastDelegate<sbk_id, sbk_id>& get_on_update_id();
28 [[nodiscard]] MulticastDelegate<std::string_view, std::string_view>& get_on_update_name();
29
30 private:
31 MulticastDelegate<sbk_id, sbk_id> m_onUpdateID;
32 MulticastDelegate<std::string_view, std::string_view> m_onUpdateName;
33
34 std::string m_objectName;
35 sbk_id m_objectID = 0;
36
37 bool editorHidden = false; //< If true, the object won't render in the editor or be saved
38
39 friend class database;
40 };
41} // namespace sbk::core
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:12
Runtime lookup of objects, using their ID or name.
Definition database.h:15
Base object that all sound Bakery objects should inherit from.
Definition object.h:21