PETDeckHydrator
- class SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator
- Hydrator class responsible for transforming data returned by the DB into actual objects, either Age cards, or tokensServes as middleware between the deck component and the objects defined in this project that rely on the component.All undocumented methods are wrappers for the deck component whose documentation can be found on the BGA StudioDocumentation Wiki: https://en.doc.boardgamearena.net/Deck/
Summary
Methods
public createCards($PETDeckCardsArray, $location, $locationArg, $playerCount)
public pickCardForLocation($fromLocation, $toLocation, $locationArg)
public pickCardsForLocation($number, $fromLocation, $toLocation, $locationArg, $noDeckReform)
public moveCards($PETAgeCardsArray, $location, $locationArg)
public insertCardOnExtremePosition($PETCardToken, $location, $bOnTop)
public moveAllCardsInLocation($fromLocation, $toLocation, $fromLocationArg, $toLocationArg)
public moveAllCardsInLocationKeepOrder($fromLocation, $toLocation)
public getCardsInLocation($location, $locationArg, $orderBy)
public getCardsOfTypeInLocation($deckType, $typeArg, $location, $locationArg)
Properties
- private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$cardTypes
- Card Types array used by the deck component
- Source
- Type
array
- private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$tokenTypes
- Token types array used by the component
- Source
- Type
array
- private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$deckModule
- Deck component from the BGA framework
- Source
- Type
\Deck
Methods
- private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::hydrateCard($cardArray)
- Returns the PETAgeCard or PETToken object associated to the card from the Deck component. If none is found, thennull is returned
- Source
- Parameters
$cardArray (array | null)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard
|\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETToken
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::setCardTypes($cardTypes)
- Source
- Parameters
$cardTypes (array)
- Returns
$this
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::setTokenTypes($tokenTypes)
- Source
- Parameters
$tokenTypes (array)
- Returns
$this
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::init($deckModule, $cardTable)
- Wrapper fot Deck::init function
- Source
- Parameters
$deckModule (
Deck
)$cardTable (string)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::createCards($PETDeckCardsArray, $location=\'deck\', $locationArg=null, $playerCount=1)
- Source
- Parameters
$PETDeckCardsArray (
SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface[]
)$location (string)
$locationArg (int | null)
$playerCount (int)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCard($location, $playerId)
- Source
- Parameters
$location (string)
$playerId (int)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCards($number, $location, $playerId)
- Source
- Parameters
$number (int)
$location (string)
$playerId (int)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard[]
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCardForLocation($fromLocation, $toLocation, $locationArg=0)
- Source
- Parameters
$fromLocation (string)
$toLocation (string)
$locationArg (int)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCardsForLocation($number, $fromLocation, $toLocation, $locationArg=0, $noDeckReform=false)
- Source
- Parameters
$number (int)
$fromLocation (string)
$toLocation (string)
$locationArg (int)
$noDeckReform (bool)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard[]
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveCard($PETCardToken, $location, $locationArg=0)
- Source
- Parameters
$PETCardToken (
SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
)$location (string)
$locationArg (int)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveCards($PETAgeCardsArray, $location, $locationArg=null)
- Source
- Parameters
$PETAgeCardsArray (
SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface[]
)$location (string)
$locationArg (int | null)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::insertCard($PETCardToken, $location, $locationArg)
- Source
- Parameters
$PETCardToken (
SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
)$location (string)
$locationArg (int)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::insertCardOnExtremePosition($PETCardToken, $location, $bOnTop)
- Source
- Parameters
$PETCardToken (
SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
)$location (string)
$bOnTop (bool) if true, card is inserted on the top, on the bottom otherwise
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveAllCardsInLocation($fromLocation, $toLocation, $fromLocationArg=null, $toLocationArg=0)
- Source
- Parameters
$fromLocation (string)
$toLocation (string)
$fromLocationArg (int | null)
$toLocationArg (int)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveAllCardsInLocationKeepOrder($fromLocation, $toLocation)
- Source
- Parameters
$fromLocation (string)
$toLocation (string)
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::playCard($PETCardToken)
- Source
- Parameters
- Returns
void
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCard($cardId)
- Source
- Parameters
$cardId (int)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCards($cardIds)
- Source
- Parameters
$cardIds (array)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsInLocation($location, $locationArg=null, $orderBy=null)
- Source
- Parameters
$location (string)
$locationArg (int | null)
$orderBy (string | null)
- Returns
array | null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardInLocation($location, $locationArg=null)
- Source
- Parameters
$location (string)
$locationArg (int | null)
- Returns
int
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardsInLocations()
- Source
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardsByLocationArgs($location)
- Source
- Parameters
$location (string)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getPlayerHand($playerId)
- Source
- Parameters
$playerId (int)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardOnTop($location)
- Source
- Parameters
$location (string)
- Returns
\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface
| null
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOnTop($number, $location)
- Source
- Parameters
$number (int)
$location (string)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getExtremePosition($bGetMax, $location)
- Source
- Parameters
$bGetMax (bool)
$location (string)
- Returns
int
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOfType($deckType, $typeArg)
- Source
- Parameters
$deckType (string)
$typeArg (int | null)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOfTypeInLocation($deckType, $typeArg=null, $location, $locationArg=null)
- Source
- Parameters
$deckType (string)
$typeArg (int | null)
$location (string)
$locationArg (int | null)
- Returns
array
- public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::shuffle($location)
- Source
- Parameters
$location (string)
- Returns
void