Simulator::cGetOutOfUFOToolStrategy class

Base classes

class cToolStrategy

Public static variables

static const uint32_t STRATEGY_ID

Public functions

auto OnSelect(cSpaceToolData* pTool) -> bool override
Called when the user clicks on the tool button to select it.
auto Update(cSpaceToolData* pTool, bool showErrors, const char16_t** ppFailText = nullptr) -> bool override
Called every game loop if the tool is visible, that is, if the panel that contains it is selected or if the tool is selected.
auto WhileAiming(cSpaceToolData* pTool, const Vector3& aimPoint, bool showErrors) -> bool override
auto OnHit(cSpaceToolData* pTool, const Vector3& position, cSpaceToolData::SpaceToolHit hitType) -> bool override

Function documentation

bool Simulator::cGetOutOfUFOToolStrategy::OnSelect(cSpaceToolData* pTool) override

Called when the user clicks on the tool button to select it.

Parameters
pTool The space tool.

The return value is ignored.

bool Simulator::cGetOutOfUFOToolStrategy::Update(cSpaceToolData* pTool, bool showErrors, const char16_t** ppFailText = nullptr) override

Called every game loop if the tool is visible, that is, if the panel that contains it is selected or if the tool is selected.

Parameters
pTool The space tool.
showErrors Whether event logs should be shown to the player or not.
ppFailText [Optional] If not null, an error text can be set so that it is shown in the tool button.
Returns Whether the tool must be enabled or not.

The return value is used to tell if the tool is available to be used or not. If the method returns false, the tool is disabled and cannot be selected. If the method returns true, the tool is enabled and can be used.