2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -3,43 +3,33 @@
#include "CRelayTracker.hpp"
#include "TCastTo.hpp"
namespace urde
{
namespace urde {
CScriptMemoryRelay::CScriptMemoryRelay(TUniqueId uid, std::string_view name, const CEntityInfo& info, bool b1,
bool skipSendActive, bool ignoreMessages)
: CEntity(uid, info, true, name),
x34_24_(b1),
x34_25_skipSendActive(skipSendActive),
x34_26_ignoreMessages(ignoreMessages)
{
: CEntity(uid, info, true, name)
, x34_24_(b1)
, x34_25_skipSendActive(skipSendActive)
, x34_26_ignoreMessages(ignoreMessages) {}
void CScriptMemoryRelay::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptMemoryRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) {
if (x34_26_ignoreMessages)
return;
if (msg == EScriptObjectMessage::Deactivate) {
stateMgr.GetRelayTracker()->RemoveRelay(xc_editorId);
return;
} else if (msg == EScriptObjectMessage::Activate) {
stateMgr.GetRelayTracker()->AddRelay(xc_editorId);
if (!x34_25_skipSendActive)
SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
return;
}
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
}
void CScriptMemoryRelay::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
void CScriptMemoryRelay::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager &stateMgr)
{
if (x34_26_ignoreMessages)
return;
if (msg == EScriptObjectMessage::Deactivate)
{
stateMgr.GetRelayTracker()->RemoveRelay(xc_editorId);
return;
}
else if (msg == EScriptObjectMessage::Activate)
{
stateMgr.GetRelayTracker()->AddRelay(xc_editorId);
if (!x34_25_skipSendActive)
SendScriptMsgs(EScriptObjectState::Active, stateMgr, EScriptObjectMessage::None);
return;
}
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
}
}
} // namespace urde