Files
DarkflameServer/dGame/dBehaviors/AndBehavior.cpp
David Markowitz 396dcb0465 feat: add logger feature to log on function entry and exit (#1924)
* feat: add logger feature to log on function entry and exit

* i didnt save the file
2025-10-25 14:53:49 -05:00

37 lines
1.0 KiB
C++

#include "AndBehavior.h"
#include "BehaviorBranchContext.h"
#include "Game.h"
#include "Logger.h"
void AndBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream, const BehaviorBranchContext branch) {
for (auto* behavior : this->m_behaviors) {
behavior->Handle(context, bitStream, branch);
}
}
void AndBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStream, const BehaviorBranchContext branch) {
LOG_ENTRY;
for (auto* behavior : this->m_behaviors) {
LOG("%i calculating %i", m_behaviorId, behavior->GetBehaviorID());
behavior->Calculate(context, bitStream, branch);
}
}
void AndBehavior::UnCast(BehaviorContext* context, const BehaviorBranchContext branch) {
for (auto behavior : this->m_behaviors) {
behavior->UnCast(context, branch);
}
}
void AndBehavior::Load() {
const auto parameters = GetParameterNames();
for (const auto& parameter : parameters) {
if (parameter.first.rfind("behavior", 0) == 0) {
auto* action = GetAction(parameter.second);
this->m_behaviors.push_back(action);
}
}
}