PETActionFunctionsTrait
- trait SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Traits\Utility\PETActionFunctionsTrait
 - Trait holding functions relative to action handling
 
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 gamesense)
- Source
 - 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 actionthat the player is currently doing
- Source
 - 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 atechnology, draw cards, quick draw, shuffle & draw)
- Source
 - 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 ifthe player has no actions left
- Source
 - 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
 - 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 checkwhether the move is cancelable
- Source
 - Parameters
 $actionToCancel (int)
$playerId (int)
- Returns
 void