From 581b3ef144554b7046c21a5b3ab7a4542f3efe77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 2 Dec 2020 18:28:58 +0100 Subject: ksys/act: Add ActorUtil header (and one function implementation) --- src/KingSystem/ActorSystem/actActorUtil.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/KingSystem/ActorSystem/actActorUtil.cpp (limited to 'src/KingSystem/ActorSystem/actActorUtil.cpp') diff --git a/src/KingSystem/ActorSystem/actActorUtil.cpp b/src/KingSystem/ActorSystem/actActorUtil.cpp new file mode 100644 index 00000000..69f6f51f --- /dev/null +++ b/src/KingSystem/ActorSystem/actActorUtil.cpp @@ -0,0 +1,20 @@ +#include "KingSystem/ActorSystem/actActorUtil.h" +#include "KingSystem/ActorSystem/actActor.h" +#include "KingSystem/ActorSystem/actActorParam.h" +#include "KingSystem/ActorSystem/actInfoData.h" +#include "KingSystem/Resource/resResourceActorLink.h" + +namespace ksys::act { + +bool hasTag(Actor* actor, const sead::SafeString& tag) { + if (!actor) + return false; + return actor->getParam()->getRes().mActorLink->hasTag(tag.cstr()); +} + +bool hasTag(const sead::SafeString& actor, const sead::SafeString& tag) { + auto* data = InfoData::instance(); + return data && data->hasTag(actor.cstr(), tag.cstr()); +} + +} // namespace ksys::act -- cgit v1.2.3