From 4336cb7f506c70f4479f3e9bedb47ea360131828 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 1 Aug 2023 01:36:24 -0700 Subject: [PATCH] quick notes --- dGame/dComponents/MovingPlatformComponent.cpp | 13 +++++++++---- dGame/dComponents/MovingPlatformComponent.h | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dGame/dComponents/MovingPlatformComponent.cpp b/dGame/dComponents/MovingPlatformComponent.cpp index e34f4d40..c33c073c 100644 --- a/dGame/dComponents/MovingPlatformComponent.cpp +++ b/dGame/dComponents/MovingPlatformComponent.cpp @@ -123,6 +123,8 @@ void SimpleMoverPlatformSubComponent::LoadDataFromTemplate() { NiPoint3 platformMove = platformEntry->platformMove; float moveTime = platformEntry->moveTime; + m_PlatformMove = platformMove; + m_MoveTime = moveTime; } SimpleMoverPlatformSubComponent::SimpleMoverPlatformSubComponent(MovingPlatformComponent* parentComponent, const NiPoint3& platformMove, const bool startsInReverse) : PlatformSubComponent(parentComponent) { @@ -143,6 +145,10 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri } +void MovingPlatformComponent::LoadDataFromTemplate() { + std::for_each(m_Platforms.begin(), m_Platforms.end(), [](const std::unique_ptr& platform) { platform->LoadDataFromTemplate(); }); +} + void MovingPlatformComponent::LoadConfigData() { if (m_Parent->GetVar(u"platformIsSimpleMover")) { AddMovingPlatform(NiPoint3::ZERO, false); @@ -212,6 +218,7 @@ void MovingPlatformComponent::GotoWaypoint(uint32_t index, bool stopAtWaypoint) } void MovingPlatformComponent::StartPathing() { + // state == Travelling // //GameMessages::SendStartPathing(m_Parent); // m_PathingStopped = false; @@ -263,6 +270,7 @@ void MovingPlatformComponent::StartPathing() { } void MovingPlatformComponent::ContinuePathing() { + // state == Travelling // auto* subComponent = static_cast(m_MoverSubComponent); // subComponent->mState = eMovementPlatformState::Stationary; @@ -373,6 +381,7 @@ void MovingPlatformComponent::ContinuePathing() { } void MovingPlatformComponent::StopPathing() { + // state == Stopped //m_Parent->CancelCallbackTimers(); // auto* subComponent = static_cast(m_MoverSubComponent); @@ -388,10 +397,6 @@ void MovingPlatformComponent::StopPathing() { //GameMessages::SendPlatformResync(m_Parent, UNASSIGNED_SYSTEM_ADDRESS); } -void MovingPlatformComponent::SetSerialized(bool value) { - // m_Serialize = value; -} - bool MovingPlatformComponent::GetNoAutoStart() const { return false; // return m_NoAutoStart; diff --git a/dGame/dComponents/MovingPlatformComponent.h b/dGame/dComponents/MovingPlatformComponent.h index 343cae3b..94514e51 100644 --- a/dGame/dComponents/MovingPlatformComponent.h +++ b/dGame/dComponents/MovingPlatformComponent.h @@ -37,6 +37,8 @@ public: virtual void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate); virtual eMoverSubComponentType GetPlatformType() { return eMoverSubComponentType::None; }; bool GetIsDirty() const { return m_IsDirty; } + virtual void LoadDataFromTemplate() {}; + virtual void LoadConfigData() {}; protected: #ifdef _MOVING_PLATFORM_TEST @@ -85,8 +87,8 @@ public: SimpleMoverPlatformSubComponent(MovingPlatformComponent* parentComponent, const NiPoint3& platformMove, const bool startAtEnd); ~SimpleMoverPlatformSubComponent() override = default; eMoverSubComponentType GetPlatformType() override { return eMoverSubComponentType::SimpleMover; } - void LoadConfigData(); - void LoadDataFromTemplate(); + void LoadConfigData() override; + void LoadDataFromTemplate() override; void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override; bool m_HasStartingPoint = false; bool m_DirtyStartingPoint = false; @@ -110,6 +112,7 @@ public: MovingPlatformComponent(Entity* parent, const std::string& pathName); + void LoadDataFromTemplate(); void LoadConfigData(); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);