Added comments

This commit is contained in:
EmosewaMC 2022-01-20 03:26:41 -08:00
parent 15831e8d6c
commit 6fc0683ce9
2 changed files with 16 additions and 6 deletions

View File

@ -2,14 +2,10 @@
#include "SkillComponent.h" #include "SkillComponent.h"
#include "dLogger.h" #include "dLogger.h"
void AgSurvivalBuffStation::OnStartup(Entity* self) {
Game::logger->Log("AgSurvivalBuffStation", "Spawning survival buff station!\n");
}
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) { void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
auto skillComponent = self->GetComponent<SkillComponent>(); auto skillComponent = self->GetComponent<SkillComponent>();
if (skillComponent == nullptr) return; if (skillComponent == nullptr) return;
skillComponent->CalculateBehavior(201, 1784, self->GetObjectID()); skillComponent->CalculateBehavior(skillIdForBuffStation, behaviorIdForBuffStation, self->GetObjectID());
} }

View File

@ -4,6 +4,20 @@
class AgSurvivalBuffStation : public CppScripts::Script class AgSurvivalBuffStation : public CppScripts::Script
{ {
public: public:
void OnStartup(Entity* self) override; /**
* @brief When the rebuild of self is complete, we calculate the behavior that is assigned to self in the database.
*
* @param self The Entity that called this script.
* @param target The target of the self that called this script.
*/
void OnRebuildComplete(Entity* self, Entity* target) override; void OnRebuildComplete(Entity* self, Entity* target) override;
private:
/**
* Skill ID for the buff station.
*/
uint32_t skillIdForBuffStation = 201;
/**
* Behavior ID for the buff station.
*/
uint32_t behaviorIdForBuffStation = 1784;
}; };