From 0d06559bcc3d60595cedcab343408589dcdb9c94 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 12 Feb 2023 11:38:48 -0400 Subject: TObject: Make non-function members private, and add getters, and setters --- include/pso/TObject.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/pso/TObject.h') diff --git a/include/pso/TObject.h b/include/pso/TObject.h index 8d3e6e8..9af0251 100644 --- a/include/pso/TObject.h +++ b/include/pso/TObject.h @@ -44,7 +44,7 @@ static inline void operator&=(object_flags &a, object_flags b) { a = a & b; }; static inline void operator|=(object_flags &a, object_flags b) { a = a | b; }; class TObject { -public: +private: const char *name; union { object_flags flags; @@ -73,6 +73,24 @@ public: void *operator new (size_t size) { return alloc(size); }; void operator delete(void *ptr) { free(ptr); }; + const char *get_name() { return this->name; }; + object_flags get_flags() { return this->flags; }; + u16 get_flags_u16() { return this->flags_u16; }; + u16 get_id() { return this->id; }; + TObject *get_prev() { return this->prev; }; + TObject *get_next() { return this->next; }; + TObject *get_up() { return this->up; }; + TObject *get_down() { return this->down; }; + + void set_name(const char *name) { this->name = name; }; + void set_obj_flags(object_flags flags) { this->flags = flags; }; + void set_flags_u16(u16 flags) { flags_u16 = flags; }; + void set_id(u16 id) { this->id = id; }; + void set_prev(TObject *node) { prev = node; }; + void set_next(TObject *node) { next = node; }; + void set_up(TObject *node) { up = node; }; + void set_down(TObject *node) { down = node; }; + void delete_children(); void queue_destruction_for_each_node(); void run_tasks(); -- cgit v1.2.3-13-gbd6f