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 SB::Core
6{
8 {
9 public:
10 virtual void onLoaded() {}
11 virtual void onProjectLoaded() {}
12 virtual void onDestroy() {}
13
14 REGISTER_REFLECTION(DatabaseObjectUtilities)
15 };
16
21 class SB_CLASS DatabaseObject : public Object, public DatabaseObjectUtilities
22 {
23 REGISTER_REFLECTION(DatabaseObject, Object, DatabaseObjectUtilities)
24
25 public:
27
28 SB_ID getDatabaseID() const;
29 void setDatabaseID(SB_ID id);
30
31 std::string_view getDatabaseName() const;
32 void setDatabaseName(std::string_view name);
33
34 bool getEditorHidden() const { return editorHidden; }
35 void setEditorHidden(bool hidden) { editorHidden = hidden; }
36
37 public:
38 operator SB_ID() const { return m_objectID; }
39
40 private:
41 std::string m_objectName;
42 SB_ID m_objectID = 0;
43
44 bool editorHidden = false; //< If true, the object won't render in the editor or be saved
45
46 friend class Database;
47 };
48} // namespace SB::Core
Definition database_object.h:8
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:22
Runtime lookup of objects, using their ID or name.
Definition database.h:11
Simple base Object that all Sound Bakery objects should inherit from.
Definition object.h:33