Another consistency pass

- 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
This commit is contained in:
David Markowitz
2023-06-16 01:01:13 -07:00
parent 9a9b9aa813
commit 92006123b8
29 changed files with 142 additions and 183 deletions

View File

@@ -1,5 +1,6 @@
#include "AmBridge.h"
#include "EntityManager.h"
#include "Entity.h"
void AmBridge::OnStartup(Entity* self) {
@@ -14,7 +15,7 @@ void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
auto* console = consoles[0];
console->NotifyObject(self, "BridgeBuilt");
console->NotifyObject(self, u"BridgeBuilt");
self->AddTimer("SmashBridge", 50);
}

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "SimplePhysicsComponent.h"
#include "eTerminateType.h"
#include "Entity.h"
void AmDrawBridge::OnStartup(Entity* self) {
self->SetNetworkVar(u"InUse", false);
@@ -72,8 +73,8 @@ void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
}
}
void AmDrawBridge::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
if (name == "BridgeBuilt") {
void AmDrawBridge::OnNotifyObject(Entity* self, Entity* sender, const std::u16string& name, int32_t param1, int32_t param2) {
if (name == u"BridgeBuilt") {
self->SetVar(u"BridgeID", sender->GetObjectID());
self->AddTimer("SmashEffectBridge", 45);

View File

@@ -7,7 +7,7 @@ public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
void OnTimerDone(Entity* self, std::string timerName) override;
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
void OnNotifyObject(Entity* self, Entity* sender, const std::u16string& name, int32_t param1 = 0, int32_t param2 = 0) override;
void MoveBridgeDown(Entity* self, Entity* bridge, bool down);
void NotifyDie(Entity* self, Entity* other);

View File

@@ -10,7 +10,7 @@ void AmSkullkinDrillStand::OnStartup(Entity* self) {
self->SetProximityRadius(new dpEntity(self->GetObjectID(), { 6, 14, 6 }), "knockback");
}
void AmSkullkinDrillStand::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
void AmSkullkinDrillStand::OnNotifyObject(Entity* self, Entity* sender, const std::u16string& name, int32_t param1, int32_t param2) {
}

View File

@@ -6,7 +6,7 @@ class AmSkullkinDrillStand : public CppScripts::Script
public:
void OnStartup(Entity* self) override;
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
void OnNotifyObject(Entity* self, Entity* sender, const std::u16string& name, int32_t param1 = 0, int32_t param2 = 0) override;
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
};