mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
format codebase
This commit is contained in:
@@ -9,20 +9,19 @@
|
||||
#include "EntityManager.h"
|
||||
|
||||
|
||||
void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_stream, BehaviorBranchContext branch)
|
||||
{
|
||||
void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_stream, BehaviorBranchContext branch) {
|
||||
float value;
|
||||
|
||||
bit_stream->Read(value);
|
||||
|
||||
|
||||
uint32_t trigger = 0;
|
||||
|
||||
for (unsigned int i = 0; i < this->m_behaviors.size(); i++) {
|
||||
|
||||
|
||||
const double data = this->m_behaviors.at(i).first;
|
||||
|
||||
|
||||
if (value <= data) {
|
||||
|
||||
|
||||
trigger = i;
|
||||
|
||||
break;
|
||||
@@ -34,8 +33,7 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream*
|
||||
behavior->Handle(context, bit_stream, branch);
|
||||
}
|
||||
|
||||
void SwitchMultipleBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bit_stream, BehaviorBranchContext branch)
|
||||
{
|
||||
void SwitchMultipleBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bit_stream, BehaviorBranchContext branch) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -45,7 +43,7 @@ void SwitchMultipleBehavior::Load() {
|
||||
"(select bP2.value FROM BehaviorParameter bP2 WHERE bP2.behaviorID = ?1 AND bP2.parameterID LIKE 'value %' "
|
||||
"AND replace(bP1.parameterID, 'behavior ', '') = replace(bP2.parameterID, 'value ', '')) as value "
|
||||
"FROM BehaviorParameter bP1 WHERE bP1.behaviorID = ?1 AND bP1.parameterID LIKE 'behavior %';");
|
||||
query.bind(1, (int) this->m_behaviorId);
|
||||
query.bind(1, (int)this->m_behaviorId);
|
||||
|
||||
auto result = query.execQuery();
|
||||
|
||||
@@ -57,7 +55,7 @@ void SwitchMultipleBehavior::Load() {
|
||||
auto value = result.getFloatField(2);
|
||||
|
||||
this->m_behaviors.emplace_back(value, behavior);
|
||||
|
||||
|
||||
result.nextRow();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user