2021-12-05 17:54:36 +00:00
|
|
|
#include "LUPExhibitComponent.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void LUPExhibitComponent::Update(float deltaTime) {
|
|
|
|
m_UpdateTimer += deltaTime;
|
|
|
|
if (m_UpdateTimer > 20.0f) {
|
2023-12-29 04:24:45 +00:00
|
|
|
NextLUPExhibit();
|
2022-07-28 13:39:57 +00:00
|
|
|
m_UpdateTimer = 0.0f;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-08-10 21:33:15 +00:00
|
|
|
void LUPExhibitComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) {
|
2023-12-29 04:24:45 +00:00
|
|
|
outBitStream->Write(m_DirtyLUPExhibit);
|
|
|
|
if (m_DirtyLUPExhibit) {
|
|
|
|
outBitStream->Write(m_LUPExhibits[m_LUPExhibitIndex % m_LUPExhibits.size()]);
|
|
|
|
if (!bIsInitialUpdate) m_DirtyLUPExhibit = false;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|