holy mother of const

Use const everywhere that makes sense
return const variables when it makes sense
const functions and variables again, where it makes sense
No raw access and modifications to protected members
Move template definitions to tcc file

idk how I feel about this one
This commit is contained in:
EmosewaMC
2023-06-09 01:04:42 -07:00
parent d11e2db887
commit ec00f5fd9d
28 changed files with 334 additions and 336 deletions

View File

@@ -17,7 +17,7 @@ void WaveBossApe::OnStartup(Entity* self) {
combatAIComponent->SetStunImmune(true);
}
self->AddToGroup("boss");
self->AddToGroups("boss");
BaseEnemyApe::OnStartup(self);
}

View File

@@ -11,7 +11,7 @@ void WaveBossHammerling::OnStartup(Entity* self) {
combatAIComponent->SetStunImmune(true);
}
self->AddToGroup("boss");
self->AddToGroups("boss");
}
void WaveBossHammerling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,

View File

@@ -11,7 +11,7 @@ void WaveBossHorsemen::OnStartup(Entity* self) {
combatAIComponent->SetStunImmune(true);
}
self->AddToGroup("boss");
self->AddToGroups("boss");
}
void

View File

@@ -11,7 +11,7 @@ void WaveBossSpiderling::OnStartup(Entity* self) {
combatAIComponent->SetStunImmune(true);
}
self->AddToGroup("boss");
self->AddToGroups("boss");
}
void WaveBossSpiderling::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,

View File

@@ -123,7 +123,7 @@ void NtCombatChallengeServer::OnChildLoaded(Entity* self, Entity* child) {
EntityManager::Instance()->SerializeEntity(child);
child->GetGroups().push_back("targets_" + std::to_string(self->GetObjectID()));
child->AddToGroups("targets_" + std::to_string(self->GetObjectID()));
}
void NtCombatChallengeServer::ResetGame(Entity* self) {

View File

@@ -51,7 +51,7 @@ void EnemySpiderSpawner::OnTimerDone(Entity* self, std::string timerName) {
Entity* newEntity = EntityManager::Instance()->CreateEntity(info, nullptr);
if (newEntity) {
EntityManager::Instance()->ConstructEntity(newEntity);
newEntity->GetGroups().push_back("BabySpider");
newEntity->AddToGroups("BabySpider");
/*
auto movementAi = newEntity->GetComponent<MovementAIComponent>();

View File

@@ -18,7 +18,7 @@ void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
self->SetVar(u"RebuildComplete", true);
self->SetVar(u"NumWarnings", 0);
self->AddToGroup("reset");
self->AddToGroups("reset");
}
}

View File

@@ -2,7 +2,7 @@
#include "Entity.h"
void WildNinjaBricks::OnStartup(Entity* self) {
self->AddToGroup("Ninjastuff");
self->AddToGroups("Ninjastuff");
}
void WildNinjaBricks::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {

View File

@@ -2,7 +2,7 @@
#include "GameMessages.h"
void WildNinjaStudent::OnStartup(Entity* self) {
self->AddToGroup("Ninjastuff");
self->AddToGroups("Ninjastuff");
GameMessages::SendPlayAnimation(self, u"bow");
}