Simulator::cRepairToolStrategy class

Base classes

class cToolStrategy

Derived classes

class cEnergyRepairToolStrategy

Public static variables

static const uint32_t STRATEGY_ID

Public functions

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 OnHit(cSpaceToolData* pTool, const Vector3& position, cSpaceToolData::SpaceToolHit hitType) -> bool override
auto WhileFiring(cSpaceToolData* pTool, const Vector3& aimPoint, int) -> bool override
auto ProcessCost(int useCost) -> int override
Function called to calculate the sporebucks cost of firing the tool.

Function documentation

bool Simulator::cRepairToolStrategy::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.

int Simulator::cRepairToolStrategy::ProcessCost(int useCost) override

Function called to calculate the sporebucks cost of firing the tool.

It receives the value of the