mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 15:57:13 +00:00
Components get the client's per-component functions: LoadDataFromTemplate, PrepareConfigData, LoadConfigData, LoadFromSaveData, Startup, Run, OnEnterScope, OnLeaveScope, Preshutdown and Shutdown, called by the entity in the client's order. Update is renamed Run, LoadFromXml LoadFromSaveData and UpdateXml WriteSaveData. Nothing sent changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
661 B
C++
25 lines
661 B
C++
#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) {
|
|
outBitStream.Write(m_DirtyLUPExhibit);
|
|
if (m_DirtyLUPExhibit) {
|
|
outBitStream.Write(m_LUPExhibits[m_LUPExhibitIndex % m_LUPExhibits.size()]);
|
|
if (!bIsInitialUpdate) m_DirtyLUPExhibit = false;
|
|
}
|
|
}
|