format codebase

This commit is contained in:
aronwk-aaron
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -4,47 +4,41 @@
#include "EntityManager.h"
#include "BaseCombatAIComponent.h"
void ChangeOrientationBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch)
{
void ChangeOrientationBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
}
void ChangeOrientationBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch)
{
if (!m_ToTarget) return; // TODO: Add the other arguments to this behavior
void ChangeOrientationBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
if (!m_ToTarget) return; // TODO: Add the other arguments to this behavior
auto* self = EntityManager::Instance()->GetEntity(context->originator);
auto* other = EntityManager::Instance()->GetEntity(branch.target);
auto* self = EntityManager::Instance()->GetEntity(context->originator);
auto* other = EntityManager::Instance()->GetEntity(branch.target);
if (self == nullptr || other == nullptr) return;
if (self == nullptr || other == nullptr) return;
const auto source = self->GetPosition();
const auto destination = self->GetPosition();
const auto source = self->GetPosition();
const auto destination = self->GetPosition();
if (m_OrientCaster)
{
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
if (m_OrientCaster) {
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();
/*if (baseCombatAIComponent != nullptr)
{
baseCombatAIComponent->LookAt(destination);
}
else*/
{
self->SetRotation(NiQuaternion::LookAt(source, destination));
}
/*if (baseCombatAIComponent != nullptr)
{
baseCombatAIComponent->LookAt(destination);
}
else*/
{
self->SetRotation(NiQuaternion::LookAt(source, destination));
}
EntityManager::Instance()->SerializeEntity(self);
}
else
{
other->SetRotation(NiQuaternion::LookAt(destination, source));
EntityManager::Instance()->SerializeEntity(self);
} else {
other->SetRotation(NiQuaternion::LookAt(destination, source));
EntityManager::Instance()->SerializeEntity(other);
}
EntityManager::Instance()->SerializeEntity(other);
}
}
void ChangeOrientationBehavior::Load()
{
m_OrientCaster = GetBoolean("orient_caster");
m_ToTarget = GetBoolean("to_target");
void ChangeOrientationBehavior::Load() {
m_OrientCaster = GetBoolean("orient_caster");
m_ToTarget = GetBoolean("to_target");
}