#include "LUPExhibitComponent.h" #include "EntityManager.h" void LUPExhibitComponent::Run(float deltaTime) { m_UpdateTimer += deltaTime; if (m_UpdateTimer > 20.0f) { NextLUPExhibit(); m_UpdateTimer = 0.0f; } } void LUPExhibitComponent::NextLUPExhibit() { m_LUPExhibitIndex++; m_DirtyLUPExhibit = true; Game::entityManager->SerializeEntity(m_Parent); } void LUPExhibitComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) { // LWOLUPExhibitComponent::Deserialize (0x00c63790) only learns the exhibit from this block, so a client the object // comes into range of gets it too const bool writeExhibit = bIsInitialUpdate || m_DirtyLUPExhibit; outBitStream.Write(writeExhibit); if (writeExhibit) { outBitStream.Write(m_LUPExhibits[m_LUPExhibitIndex % m_LUPExhibits.size()]); if (!bIsInitialUpdate) m_DirtyLUPExhibit = false; } }