2021-12-05 17:54:36 +00:00
|
|
|
#include "LUPExhibitComponent.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
void LUPExhibitComponent::Update(float deltaTime) {
|
|
|
|
m_UpdateTimer += deltaTime;
|
|
|
|
if (m_UpdateTimer > 20.0f) {
|
2023-12-29 04:24:45 +00:00
|
|
|
NextLUPExhibit();
|
2021-12-05 17:54:36 +00:00
|
|
|
m_UpdateTimer = 0.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-29 04:24:45 +00:00
|
|
|
void LUPExhibitComponent::NextLUPExhibit() {
|
|
|
|
m_LUPExhibitIndex++;
|
|
|
|
m_DirtyLUPExhibit = true;
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->SerializeEntity(m_Parent);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2024-02-27 07:25:44 +00:00
|
|
|
void LUPExhibitComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
|
|
|
outBitStream.Write(m_DirtyLUPExhibit);
|
2023-12-29 04:24:45 +00:00
|
|
|
if (m_DirtyLUPExhibit) {
|
2024-02-27 07:25:44 +00:00
|
|
|
outBitStream.Write(m_LUPExhibits[m_LUPExhibitIndex % m_LUPExhibits.size()]);
|
2023-12-29 04:24:45 +00:00
|
|
|
if (!bIsInitialUpdate) m_DirtyLUPExhibit = false;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|