2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Component.h"
|
|
|
|
#include "Entity.h"
|
2023-03-04 07:16:37 +00:00
|
|
|
#include "eReplicaComponentType.h"
|
2021-12-05 17:54:36 +00: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.
|
|
|
|
*/
|
2023-07-05 05:52:51 +00:00
|
|
|
class LUPExhibitComponent final : public Component
|
2021-12-05 17:54:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-06-09 08:22:45 +00:00
|
|
|
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::EXHIBIT;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
LUPExhibitComponent(Entity* parent);
|
|
|
|
void Update(float deltaTime) override;
|
|
|
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, uint32_t& flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* After the timer runs out, this changes the currently exhibited LOT to the next one
|
|
|
|
*/
|
|
|
|
void NextExhibit();
|
2021-12-05 17:54:36 +00:00
|
|
|
private:
|
2022-07-28 13:39:57 +00:00
|
|
|
/**
|
|
|
|
* The LOT that's currently on exhibit
|
|
|
|
*/
|
|
|
|
LOT m_Exhibit;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
/**
|
|
|
|
* The time since we've last updated the exhibit
|
|
|
|
*/
|
|
|
|
float m_UpdateTimer;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
/**
|
|
|
|
* The list of possible exhibits to show
|
|
|
|
*/
|
2023-07-05 05:52:51 +00:00
|
|
|
const std::vector<LOT> m_Exhibits = { 11121, 11295, 11423, 11979 };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
/**
|
|
|
|
* The current index in the exhibit list
|
|
|
|
*/
|
|
|
|
size_t m_ExhibitIndex;
|
2023-07-05 05:52:51 +00:00
|
|
|
|
|
|
|
// Whether or not to notify clients of a change in the visible exhibit
|
|
|
|
bool m_DirtyExhibitInfo;
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|