PETActionFunctionsTrait

trait SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait
Trait holding functions relative to action handling
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#20

Methods

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::checkRemainingAction($action, $throwException=true)
Method responsible to check whether the player is allowed to do the action (both in the framework and game
sense)
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#32

Parameters
  • $action (string)

  • $throwException (bool)

Returns

void

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::checkActionHasAlreadyStartedForPlayer($actionId, $playerId)
Checks whether a multi-step action has already been started for the player and if it corresponds to the action
that the player is currently doing
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#57

Parameters
  • $actionId (int)

  • $playerId (int)

Returns

bool

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::setCurrentActionStartForPlayer($actionId, $playerId)
Method responsible for making DB queries indicating a player has started a multi-step action (i.e. Discover a
technology, draw cards, quick draw, shuffle & draw)
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#76

Parameters
  • $actionId (int)

  • $playerId (int)

Returns

void

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::decreaseActionsCountAndChangeState($endPlayerTurn=false, $openNextAge=false)
Method responsible for decreasing the number of actions the current player has, and to jump to the next state if
the player has no actions left
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#114

Parameters
  • $openNextAge (bool) *

Returns

void

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::initializePlayerActions($playerId)
Makes changes to the DB so that the player starts with a clean DB state
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#145

Parameters
  • $playerId (int)

Returns

void

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait::cancelPlayerAction($actionToCancel, $playerId)
Makes changes to the DB so that a player can cancel an action they previously started. Calling function MUST check
whether the move is cancelable
Source

modules/php/Traits/Utility/PETActionFunctionsTrait.php#163

Parameters
  • $actionToCancel (int)

  • $playerId (int)

Returns

void