2021-12-05 17:54:36 +00:00
|
|
|
#include "LUPExhibitComponent.h"
|
|
|
|
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
LUPExhibitComponent::LUPExhibitComponent(Entity* parent) : Component(parent) {
|
|
|
|
m_Exhibits = { 11121, 11295, 11423, 11979 };
|
|
|
|
|
|
|
|
m_ExhibitIndex = 0;
|
|
|
|
|
|
|
|
m_Exhibit = m_Exhibits[m_ExhibitIndex];
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
LUPExhibitComponent::~LUPExhibitComponent() {
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LUPExhibitComponent::Update(float deltaTime) {
|
|
|
|
m_UpdateTimer += deltaTime;
|
|
|
|
|
|
|
|
if (m_UpdateTimer > 20.0f) {
|
|
|
|
NextExhibit();
|
|
|
|
|
|
|
|
m_UpdateTimer = 0.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void LUPExhibitComponent::NextExhibit() {
|
|
|
|
m_ExhibitIndex++;
|
|
|
|
|
|
|
|
if (m_ExhibitIndex >= m_Exhibits.size()) {
|
|
|
|
m_ExhibitIndex = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_Exhibit = m_Exhibits[m_ExhibitIndex];
|
|
|
|
|
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) {
|
2021-12-05 17:54:36 +00:00
|
|
|
outBitStream->Write1(); // Dirty flag?
|
|
|
|
outBitStream->Write(m_Exhibit);
|
|
|
|
}
|