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 LEAK_DETECTOR(database_object)
15
16 public:
17 [[nodiscard]] auto get_database_id() const -> sbk_id;
18 [[nodiscard]] auto get_database_name() const -> std::string_view;
19 [[nodiscard]] auto get_editor_hidden() const -> bool;
20
21 auto set_database_id(sbk_id id) -> void;
22 auto set_database_name(std::string_view name) -> void;
23 auto set_editor_hidden(bool hidden) -> void;
24
25 operator sbk_id() const { return m_objectID; }
26
27 [[nodiscard]] auto get_on_update_id() -> MulticastDelegate<sbk_id, sbk_id>&;
28 [[nodiscard]] auto get_on_update_name() -> MulticastDelegate<std::string_view, std::string_view>&;
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:23