2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:07:43 +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

@@ -5,8 +5,7 @@
#include "CStateManager.hpp"
#include "TCastTo.hpp"
namespace urde
{
namespace urde {
CScriptBeam::CScriptBeam(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
bool active, const TToken<CWeaponDescription>& weaponDesc, const CBeamInfo& bInfo,
@@ -15,47 +14,31 @@ CScriptBeam::CScriptBeam(TUniqueId uid, std::string_view name, const CEntityInfo
kInvalidUniqueId)
, xe8_weaponDescription(weaponDesc)
, xf4_beamInfo(bInfo)
, x138_damageInfo(dInfo)
{
, x138_damageInfo(dInfo) {}
void CScriptBeam::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptBeam::Think(float dt, CStateManager& mgr) {
CPlasmaProjectile* proj = static_cast<CPlasmaProjectile*>(mgr.ObjectById(x154_projectileId));
if (proj) {
if (proj->GetActive())
proj->UpdateFx(x34_transform, dt, mgr);
} else
x154_projectileId = kInvalidUniqueId;
}
void CScriptBeam::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
void CScriptBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& mgr) {
if (msg == EScriptObjectMessage::Increment) {
} else if (msg == EScriptObjectMessage::Decrement) {
} else if (msg == EScriptObjectMessage::Registered) {
x154_projectileId = mgr.AllocateUniqueId();
mgr.AddObject(new CPlasmaProjectile(xe8_weaponDescription, x10_name + "-Projectile",
x138_damageInfo.GetWeaponMode().GetType(), xf4_beamInfo, x34_transform,
EMaterialTypes::Projectile, x138_damageInfo, x8_uid, x4_areaId,
x154_projectileId, 8, false, EProjectileAttrib::PlasmaProjectile));
} else if (msg == EScriptObjectMessage::Deleted) {
}
void CScriptBeam::Think(float dt, CStateManager& mgr)
{
CPlasmaProjectile* proj = static_cast<CPlasmaProjectile*>(mgr.ObjectById(x154_projectileId));
if (proj)
{
if (proj->GetActive())
proj->UpdateFx(x34_transform, dt, mgr);
}
else
x154_projectileId = kInvalidUniqueId;
}
void CScriptBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& mgr)
{
if (msg == EScriptObjectMessage::Increment)
{
}
else if (msg == EScriptObjectMessage::Decrement)
{
}
else if (msg == EScriptObjectMessage::Registered)
{
x154_projectileId = mgr.AllocateUniqueId();
mgr.AddObject(new CPlasmaProjectile(xe8_weaponDescription, x10_name + "-Projectile",
x138_damageInfo.GetWeaponMode().GetType(), xf4_beamInfo, x34_transform,
EMaterialTypes::Projectile, x138_damageInfo, x8_uid, x4_areaId,
x154_projectileId, 8, false, EProjectileAttrib::PlasmaProjectile));
}
else if (msg == EScriptObjectMessage::Deleted)
{
}
CActor::AcceptScriptMsg(msg, objId, mgr);
}
CActor::AcceptScriptMsg(msg, objId, mgr);
}
} // namespace urde