2022-07-24 18:25:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
#include "Component.h"
|
2023-03-04 07:16:37 +00:00
|
|
|
#include "eReplicaComponentType.h"
|
2022-07-24 18:25:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Component that handles player forced movement
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class PlayerForcedMovementComponent : public Component {
|
|
|
|
public:
|
2023-03-04 07:16:37 +00:00
|
|
|
static const eReplicaComponentType ComponentType = eReplicaComponentType::PLAYER_FORCED_MOVEMENT;
|
2022-07-24 18:25:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor for this component
|
|
|
|
* @param parent parent that contains this component
|
|
|
|
*/
|
|
|
|
PlayerForcedMovementComponent(Entity* parent);
|
|
|
|
~PlayerForcedMovementComponent() override;
|
|
|
|
|
|
|
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the Player On Rail object
|
|
|
|
*
|
|
|
|
* @param value if the player is on a rail
|
|
|
|
*/
|
2022-07-28 13:39:57 +00:00
|
|
|
void SetPlayerOnRail(bool value) { m_PlayerOnRail = value; m_DirtyInfo = true; }
|
2022-07-24 18:25:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the Show Billboard object
|
|
|
|
*
|
|
|
|
* @param value if the billboard should be shown
|
|
|
|
*/
|
2022-07-28 13:39:57 +00:00
|
|
|
void SetShowBillboard(bool value) { m_ShowBillboard = value; m_DirtyInfo = true; }
|
2022-07-24 18:25:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the Player On Rail object
|
|
|
|
*
|
|
|
|
* @return true
|
|
|
|
* @return false
|
|
|
|
*/
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the Player On Rail object
|
|
|
|
*
|
|
|
|
* @return true
|
|
|
|
* @return false
|
|
|
|
*/
|
|
|
|
bool GetPlayerOnRail() { return m_PlayerOnRail; }
|
|
|
|
bool GetShowBillboard() { return m_ShowBillboard; }
|
2022-07-24 18:25:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
};
|