Move actor ref header somewhere more appropriate

This commit is contained in:
robojumper
2024-06-25 20:11:44 +02:00
parent 3be14367f8
commit 58483211c9
2 changed files with 35 additions and 27 deletions
-27
View File
@@ -28,31 +28,4 @@ public:
fBase_c *p_owner;
};
// TODO unofficial, move these to a more appropriate place
class fLiNdBaAutoUnlink_c : public fLiNdBa_c {
public:
fLiNdBaAutoUnlink_c(fBase_c *owner) : fLiNdBa_c(owner) {}
~fLiNdBaAutoUnlink_c() {
unlink();
}
};
template <typename T>
class dAcRef_c : fLiNdBaAutoUnlink_c {
public:
dAcRef_c(T *owner) : fLiNdBaAutoUnlink_c(owner) {}
dAcRef_c() : fLiNdBaAutoUnlink_c(nullptr) {}
~dAcRef_c() {}
void link(T *ref) {
p_owner = ref;
}
void unlink() {
fLiNdBa_c::unlink();
}
T *get() {
return static_cast<T *>(p_owner);
}
};
#endif