mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
51
dGame/dComponents/LUPExhibitComponent.cpp
Normal file
51
dGame/dComponents/LUPExhibitComponent.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(m_Parent);
|
||||
}
|
||||
|
||||
void LUPExhibitComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, uint32_t& flags)
|
||||
{
|
||||
outBitStream->Write1(); // Dirty flag?
|
||||
outBitStream->Write(m_Exhibit);
|
||||
}
|
Reference in New Issue
Block a user