mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-26 07:27:18 +00:00
PlayerForcedMovementComponent pass
This commit is contained in:
parent
28637a206d
commit
598d88b307
@ -1,16 +1,12 @@
|
||||
#include "PlayerForcedMovementComponent.h"
|
||||
|
||||
PlayerForcedMovementComponent::PlayerForcedMovementComponent(Entity* parent) : Component(parent) {
|
||||
m_ParentEntity = parent;
|
||||
}
|
||||
|
||||
PlayerForcedMovementComponent::~PlayerForcedMovementComponent() {}
|
||||
#include "BitStream.h"
|
||||
|
||||
void PlayerForcedMovementComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
||||
outBitStream->Write(m_DirtyInfo || bIsInitialUpdate);
|
||||
if (m_DirtyInfo || bIsInitialUpdate) {
|
||||
outBitStream->Write(m_PlayerOnRail);
|
||||
outBitStream->Write(m_ShowBillboard);
|
||||
if (!bIsInitialUpdate) m_DirtyInfo = false;
|
||||
}
|
||||
m_DirtyInfo = false;
|
||||
}
|
||||
|
@ -16,8 +16,7 @@ public:
|
||||
* Constructor for this component
|
||||
* @param parent parent that contains this component
|
||||
*/
|
||||
PlayerForcedMovementComponent(Entity* parent);
|
||||
~PlayerForcedMovementComponent() override;
|
||||
PlayerForcedMovementComponent(Entity* parent) : Component(parent) {};
|
||||
|
||||
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
||||
|
||||
@ -26,28 +25,23 @@ public:
|
||||
*
|
||||
* @param value if the player is on a rail
|
||||
*/
|
||||
void SetPlayerOnRail(bool value) { m_PlayerOnRail = value; m_DirtyInfo = true; }
|
||||
void SetPlayerOnRail(bool value) {
|
||||
if (m_PlayerOnRail == value) return;
|
||||
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; }
|
||||
void SetShowBillboard(bool value) {
|
||||
if (m_ShowBillboard == value) return;
|
||||
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; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user