mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-29 20:14:41 +00:00
36 lines
1 KiB
C++
36 lines
1 KiB
C++
#include "Library/Area/SwitchOnAreaGroup.h"
|
|
|
|
#include "Library/Area/AreaObj.h"
|
|
#include "Library/Area/AreaObjGroup.h"
|
|
#include "Library/Stage/StageSwitchUtil.h"
|
|
|
|
namespace al {
|
|
SwitchOnAreaGroup::SwitchOnAreaGroup(AreaObjGroup* areaObjGroup) : mAreaObjGroup(areaObjGroup) {}
|
|
|
|
void SwitchOnAreaGroup::update(const sead::Vector3f* positions, s32 posCount) {
|
|
s32 size = mAreaObjGroup->getSize();
|
|
for (s32 i = 0; i < size; i++) {
|
|
AreaObj* areaObj = mAreaObjGroup->getAreaObj(i);
|
|
if (isOnStageSwitch(areaObj, "SwitchAreaOn"))
|
|
continue;
|
|
|
|
for (s32 j = 0; j < posCount; j++) {
|
|
if (areaObj->isInVolume(positions[j]) && isExternalCondition()) {
|
|
onStageSwitch(areaObj, "SwitchAreaOn");
|
|
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void SwitchOnAreaGroup::update(const sead::Vector3f& position) {
|
|
sead::Vector3f positions[1] = {position};
|
|
update(positions, 1);
|
|
}
|
|
|
|
bool SwitchOnAreaGroup::isExternalCondition() const {
|
|
return true;
|
|
}
|
|
} // namespace al
|