2021-12-05 18:54:36 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Component.h"
|
|
|
|
#include "Entity.h"
|
2023-03-04 01:16:37 -06:00
|
|
|
#include "eReplicaComponentType.h"
|
2021-12-05 18:54:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Component that handles the LOT that is shown in the LUP exhibit in the LUP world. Works by setting a timer and
|
|
|
|
* switching the LOTs around that we'd like to display.
|
|
|
|
*/
|
|
|
|
class LUPExhibitComponent : public Component
|
|
|
|
{
|
|
|
|
public:
|
2023-10-22 18:08:49 -07:00
|
|
|
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::EXHIBIT;
|
2021-12-05 18:54:36 +01:00
|
|
|
|
2022-07-28 08:39:57 -05:00
|
|
|
LUPExhibitComponent(Entity* parent);
|
|
|
|
~LUPExhibitComponent();
|
|
|
|
void Update(float deltaTime) override;
|
2023-08-10 14:33:15 -07:00
|
|
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override;
|
2022-07-28 08:39:57 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* After the timer runs out, this changes the currently exhibited LOT to the next one
|
|
|
|
*/
|
|
|
|
void NextExhibit();
|
2021-12-05 18:54:36 +01:00
|
|
|
private:
|
2022-07-28 08:39:57 -05:00
|
|
|
/**
|
|
|
|
* The LOT that's currently on exhibit
|
|
|
|
*/
|
|
|
|
LOT m_Exhibit;
|
2021-12-05 18:54:36 +01:00
|
|
|
|
2022-07-28 08:39:57 -05:00
|
|
|
/**
|
|
|
|
* The time since we've last updated the exhibit
|
|
|
|
*/
|
|
|
|
float m_UpdateTimer;
|
2021-12-05 18:54:36 +01:00
|
|
|
|
2022-07-28 08:39:57 -05:00
|
|
|
/**
|
|
|
|
* The list of possible exhibits to show
|
|
|
|
*/
|
|
|
|
std::vector<LOT> m_Exhibits;
|
2021-12-05 18:54:36 +01:00
|
|
|
|
2022-07-28 08:39:57 -05:00
|
|
|
/**
|
|
|
|
* The current index in the exhibit list
|
|
|
|
*/
|
|
|
|
size_t m_ExhibitIndex;
|
2021-12-05 18:54:36 +01:00
|
|
|
};
|