mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
DoObjectComponentLoad walks the client's load order and calls the type's allocator from a table, like ObjectLoader2, instead of one 76-case switch. Components with rules of their own have a static Allocator (the client's LWOxComponent::Allocator); the rest share a registry allocator. The load state moves to ObjectLoadState.h so the allocators can take it. Construction bytes are identical for all 15,962 LOTs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
1.7 KiB
C++
76 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "Entity.h"
|
|
#include "Component.h"
|
|
#include "eReplicaComponentType.h"
|
|
|
|
struct ObjectLoadState;
|
|
|
|
/**
|
|
* Component that handles player forced movement
|
|
*
|
|
*/
|
|
class PlayerForcedMovementComponent final : public Component {
|
|
public:
|
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PLAYER_FORCED_MOVEMENT;
|
|
|
|
// The client's allocator for this type (ObjectLoader2::DoObjectComponentLoad calls it in load order)
|
|
static void Allocator(Entity& entity, ObjectLoadState& state);
|
|
|
|
/**
|
|
* Constructor for this component
|
|
* @param parent parent that contains this component
|
|
*/
|
|
PlayerForcedMovementComponent(Entity* parent, const int32_t componentID);
|
|
~PlayerForcedMovementComponent() override;
|
|
|
|
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
|
|
|
/**
|
|
* @brief Set the Player On Rail object
|
|
*
|
|
* @param value if the player is on a rail
|
|
*/
|
|
void SetPlayerOnRail(bool value) { m_PlayerOnRail = value; m_DirtyInfo = true; }
|
|
|
|
/**
|
|
* @brief Set the Show Billboard object
|
|
*
|
|
* @param value if the billboard should be shown
|
|
*/
|
|
void SetShowBillboard(bool value) { m_ShowBillboard = value; m_DirtyInfo = true; }
|
|
|
|
/**
|
|
* @brief Get the Player On Rail object
|
|
*
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
|
|
/**
|
|
* @brief Get the Player On Rail object
|
|
*
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
bool GetPlayerOnRail() { return m_PlayerOnRail; }
|
|
bool GetShowBillboard() { return m_ShowBillboard; }
|
|
|
|
private:
|
|
/**
|
|
* whether the info is dirty
|
|
*/
|
|
bool m_DirtyInfo = false;
|
|
|
|
/**
|
|
* whether the player is on a rail
|
|
*/
|
|
bool m_PlayerOnRail = false;
|
|
|
|
/**
|
|
* whether the billboard should be showing
|
|
*/
|
|
bool m_ShowBillboard = false;
|
|
|
|
};
|