Made the hurt hazard work better.

This commit is contained in:
2023-04-01 23:52:34 -07:00
parent 9167c7a88a
commit fdb1c69775
17 changed files with 141 additions and 68 deletions

View File

@ -175,6 +175,15 @@ Transform * Transform::getParent() {
return this->parent;
}
bool_t Transform::isChildOf(Transform *parent) {
Transform *current = this->getParent();
while(current != nullptr) {
if(current == parent) return true;
current = current->getParent();
}
return false;
}
Transform::~Transform() {
this->setParent(nullptr);

View File

@ -162,6 +162,15 @@ namespace Dawn {
*/
Transform * getParent();
/**
* Returns true if this transform is a child of the given transform, this
* climbs up the heirarchy until it finds a match.
*
* @param p Transform to check if this transform is a child of.
* @return True if this transform is a child of the given transform.
*/
bool_t isChildOf(Transform *p);
/**
* Dispose and clenaup this transform, also removes self from parent.
*/