Initial rodecomp source snapshot
This commit is contained in:
commit
d456e8f64a
916 changed files with 156023 additions and 0 deletions
61
Source/Contents/EffectAttachments.cpp
Normal file
61
Source/Contents/EffectAttachments.cpp
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#include "Contents/EffectAttachments.h"
|
||||
#include "Contents/RagEffectState.h"
|
||||
|
||||
// OFFSET: 0x00CADBE0
|
||||
// FUNCTION: fn_21062
|
||||
bool EffectAttachments::HasId(int id) const {
|
||||
for (const RagEffectState* effect : this->effects) {
|
||||
if (effect && effect->id == id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00CADC40
|
||||
// FUNCTION: fn_21064
|
||||
bool EffectAttachments::Contains(const RagEffectState* effect) const {
|
||||
for (const RagEffectState* current : this->effects) {
|
||||
if (current == effect) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ORIGINAL_SITE: 0x00CB4416 in fn_21111 (fragment)
|
||||
void EffectAttachments::Unlink(RagEffectState* effect) {
|
||||
if (!effect) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto entry = this->effects.begin(); entry != this->effects.end(); ++entry) {
|
||||
if (*entry == effect) {
|
||||
this->effects.erase(entry);
|
||||
|
||||
if (this->first == effect) {
|
||||
this->first = nullptr;
|
||||
} else if (this->second == effect) {
|
||||
this->second = nullptr;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notify before clearing nodes; effects are not deleted, and callback-visible list membership survives.
|
||||
// OFFSET: 0x00CA8C40
|
||||
void EffectAttachments::DetachAll() {
|
||||
for (RagEffectState* effect : this->effects) {
|
||||
if (effect) {
|
||||
effect->parent = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
this->effects.clear();
|
||||
this->first = nullptr;
|
||||
this->second = nullptr;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue