mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 06:27:24 +00:00
92006123b8
- change NotifyObject to use u16 string - move stuff to header that is inline - use u16strings instead of converting to u16 string - move entity to dEntity
30 lines
659 B
C++
30 lines
659 B
C++
#include "AmBridge.h"
|
|
#include "EntityManager.h"
|
|
#include "Entity.h"
|
|
|
|
void AmBridge::OnStartup(Entity* self) {
|
|
|
|
}
|
|
|
|
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
|
|
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
|
|
|
if (consoles.empty()) {
|
|
return;
|
|
}
|
|
|
|
auto* console = consoles[0];
|
|
|
|
console->NotifyObject(self, u"BridgeBuilt");
|
|
|
|
self->AddTimer("SmashBridge", 50);
|
|
}
|
|
|
|
void AmBridge::OnTimerDone(Entity* self, std::string timerName) {
|
|
if (timerName != "SmashBridge") {
|
|
return;
|
|
}
|
|
|
|
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
|
}
|