mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
Components no longer have a virtual OnUse; each component that reacts to a use registers a RequestUse handler, like the client's components. The entity runs the INTERACT trigger and the script, then delivers a RequestUseEvent (carrying the user) to the handlers. The mission choice of a multi-interact use goes only to the mission offer, as before. Switches keep a direct EnterIfResponding for touches and pets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Entity.h"
|
|
#include "Component.h"
|
|
#include "eReplicaComponentType.h"
|
|
|
|
/**
|
|
* Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds.
|
|
*
|
|
*/
|
|
class MultiZoneEntranceComponent final : public Component {
|
|
public:
|
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE;
|
|
|
|
/**
|
|
* Constructor for this component, builds the m_LUPWorlds vector
|
|
* @param parent parent that contains this component
|
|
*/
|
|
MultiZoneEntranceComponent(Entity* parent, const int32_t componentID);
|
|
~MultiZoneEntranceComponent() override;
|
|
|
|
/**
|
|
* Handles a RequestUse from some entity, preparing it for launch to some other world
|
|
* @param originator the entity that triggered the event
|
|
*/
|
|
bool OnRequestUse(GameMessages::RequestUseEvent& event);
|
|
|
|
/**
|
|
* Handles a RequestUse from some entity, preparing it for launch to some other world
|
|
* @param originator the entity that triggered the event
|
|
* @param index index of the world that was selected
|
|
*/
|
|
void OnSelectWorld(Entity* originator, uint32_t index);
|
|
private:
|
|
/**
|
|
* vector of the LUP World Zone IDs, built from CDServer's LUPZoneIDs table
|
|
*/
|
|
std::vector<LWOMAPID> m_LUPWorlds{};
|
|
};
|