Simulator::cPlaceColonyToolStrategy class

Base classes

class cDefaultProjectileWeapon

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 OnDeselect(cSpaceToolData* pTool) -> bool override
Called when the user clicks on the tool button to unselect it (that is, if the tool was previously selected and the user clicks again).
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 SelectedUpdate(cSpaceToolData* pTool, const Vector3& position) -> void override
Unlike Update, it's not executed if the game is paused.
auto OnHit(cSpaceToolData* pTool, const Vector3& position, SpaceToolHit hitType, int) -> bool override

Function documentation

bool Simulator::cPlaceColonyToolStrategy::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::cPlaceColonyToolStrategy::OnDeselect(cSpaceToolData* pTool) override

Called when the user clicks on the tool button to unselect it (that is, if the tool was previously selected and the user clicks again).

Parameters
pTool The space tool.

The return value is ignored.

The default implementation does nothing, just returns true.

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