Files
DarkflameServer/dGame/dComponents/MultiZoneEntranceComponent.h
Aaron Kimbrell 7a0dba22a5 refactor(component): use is a RequestUse message handler
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>
2026-10-01 07:55:55 -05:00

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{};
};