Cyrus Mod Loader
Loading...
Searching...
No Matches
storage.h
1#include <Cyrus/Classes/Window.h>
2#include <Cyrus/shared.h>
3
4namespace Cyrus {
15private:
16 std::unordered_set<PropertyClass *>
17 classMap;
18 std::mutex mtx;
19
20public:
21 CYRUS void addPropertyClass(PropertyClass *propClass);
22
23 CYRUS void removePropertyClass(PropertyClass *propClass);
24
33 CYRUS PropertyClass *findByClassName(const std::string &className);
34
43 CYRUS std::vector<PropertyClass *>
44 findAllByClassName(const std::string &className);
45
56 CYRUS PropertyClass *waitForClass(const std::string &className,
57 int timeout = 5000);
58
67 CYRUS void debugWriteToFile(const std::string &filename);
68
69 CYRUS std::unordered_map<std::string, int> getAllClasses();
70};
71
80extern CYRUS PropClassStorage classes;
81
96#define FIND_SINGLE(t) Cyrus::classes.waitForClass(#t, 1000)->as<t>();
97
98typedef void (*WindowUpdateCallback)(Window *root);
99extern CYRUS std::vector<WindowUpdateCallback> windowUpdateCallbacks;
100
109
110} // namespace Cyrus
Definition storage.h:14
CYRUS std::vector< PropertyClass * > findAllByClassName(const std::string &className)
Finds all PropertyClass objects with the given class name.
Definition storage.cpp:30
CYRUS PropertyClass * findByClassName(const std::string &className)
Finds a PropertyClass by its class name.
Definition storage.cpp:15
CYRUS void debugWriteToFile(const std::string &filename)
Writes the details of all PropertyClass objects to a file for debugging.
Definition storage.cpp:61
CYRUS PropertyClass * waitForClass(const std::string &className, int timeout=5000)
Waits for a PropertyClass with the given class name to be available.
Definition storage.cpp:45
CYRUS void addPropertyClass(PropertyClass *propClass)
Definition storage.cpp:5
CYRUS void removePropertyClass(PropertyClass *propClass)
Definition storage.cpp:10
CYRUS std::unordered_map< std::string, int > getAllClasses()
Definition storage.cpp:75
Base class for all property classes, providing reflection and serialization functionality.
Definition PropertyClass.h:86
Represents a Wizard101 Window, think anything you see on screen that is not a 3D model.
Definition Window.h:45
Definition storage.cpp:3
PropClassStorage classes
An external declaration of the PropClassStorage object.
Definition storage.cpp:84
void(* WindowUpdateCallback)(Window *root)
Definition storage.h:98
std::vector< WindowUpdateCallback > windowUpdateCallbacks
Definition storage.cpp:85
void addWindowUpdateCallback(WindowUpdateCallback callback)
Adds a callback for the Window update thread. This callback function garuntees that your Window chang...
Definition storage.cpp:87