class
cToolStrategy
Base classes
- class Object
- This class represents a basic reference counted object.
- class DefaultRefCounted
- The default implementation of a reference counted class.
Derived classes
- class cArtilleryWeaponStrategy
- class cDefaultAoETool
- class cDefaultBeamTool
- class cDefaultProjectileWeapon
- class cDragInputProjectileToolStrategy
- class cGetOutOfUFOToolStrategy
- class cGlobalMindEraseToolStrategy
- class cRallyCallToolStrategy
- class cRepairAOEToolStrategy
- class cRepairToolStrategy
- class cToggleToolStrategy
- class cTurretDefenseMissileWeapon
- class cTurretFlakWeapon
Public static variables
Constructors, destructors, conversion operators
- ~cToolStrategy() virtual
Public functions
- auto AddRef() -> int override
- auto Release() -> int override
-
auto Cast(uint32_
t type) const -> void* override -
auto GetType() -> uint32_
t virtual -
auto GetStrategyID() -> uint32_
t virtual - auto OnSelect(cSpaceToolData* pTool) -> bool virtual
- Called when the user clicks on the tool button to select it.
- auto OnDeselect(cSpaceToolData* pTool) -> bool virtual
- 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 virtual - 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 virtual
- auto OnMouseDown(cSpaceToolData* pTool, const Vector3& playerPosition) -> void virtual
- auto SelectedUpdate(cSpaceToolData* pTool, const Vector3& position) -> void virtual
- Unlike Update, it's not executed if the game is paused.
- auto OnHit(cSpaceToolData* pTool, const Vector3& position, SpaceToolHit hitType, int) -> bool virtual
- auto WhileFiring(cSpaceToolData* pTool, const Vector3& aimPoint, int) -> bool virtual
- auto OnMouseUp(cSpaceToolData* pTool) -> bool virtual
- auto GetAimPoint() -> Vector3 virtual
- Returns the coordinates of the position where the tool is aiming.
- auto func40h() -> Vector3 virtual
- auto ProcessCost(int useCost) -> int virtual
- Function called to calculate the sporebucks cost of firing the tool.
Function documentation
bool Simulator:: cToolStrategy:: OnSelect(cSpaceToolData* pTool) virtual
Called when the user clicks on the tool button to select it.
Parameters | |
---|---|
pTool | The space tool. |
The return value is ignored.
bool Simulator:: cToolStrategy:: OnDeselect(cSpaceToolData* pTool) virtual
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:: cToolStrategy:: Update(cSpaceToolData* pTool,
bool showErrors,
const char16_ t** ppFailText = nullptr) virtual
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.
Vector3 Simulator:: cToolStrategy:: GetAimPoint() virtual
Returns the coordinates of the position where the tool is aiming.
Returns | The coordinates of the position where the tool is aiming. |
---|
The default implementation uses the method cGameViewManager::
int Simulator:: cToolStrategy:: ProcessCost(int useCost) virtual
Function called to calculate the sporebucks cost of firing the tool.
It receives the value of the