DeckStacker v1.0
A card manager plugin for Unity games.
 
Loading...
Searching...
No Matches
DeckStacker.DSCardPool Class Reference
Inheritance diagram for DeckStacker.DSCardPool:

Public Member Functions

DSCard SpawnCard (DSStack targetStack_, DSCardFacing facing_=DSCardFacing.Down)
 
DSCard SpawnCard (DSStack targetStack_, DSCardPlacementInDeck placement_, DSCardFacing facing_=DSCardFacing.Down)
 
DSCard SpawnCard (DSStack targetStack_, int exactPlacement_, DSCardFacing facing_=DSCardFacing.Down)
 
DSCard GetCardFromPool ()
 
void ReturnCardToPool (DSCard returningCard_)
 

Properties

DSCard cardPrefab [get]
 
SpriteAtlas poolCardSpriteAtlas [get]
 
DSCardManagementData cardManageData [get]
 

Detailed Description

Creates an object pool of cards from the designated prefab.

The card pool is also a gateway for data attached to cards from that prefab, such as:

  • Movement easing
  • Card spacing in stacks
  • Rotation easing while flipping
  • The SpriteAtlas that contains card art for this pools card prefab

Member Function Documentation

◆ GetCardFromPool()

DSCard DeckStacker.DSCardPool.GetCardFromPool ( )
inline

Gets a card in the pool, readys it for use, and then returns that card.

◆ ReturnCardToPool()

void DeckStacker.DSCardPool.ReturnCardToPool ( DSCard returningCard_)
inline

After a card is no longer used and needs to be removed from the table, this method will reset the card's data and send it back to the object pool.

◆ SpawnCard() [1/3]

DSCard DeckStacker.DSCardPool.SpawnCard ( DSStack targetStack_,
DSCardFacing facing_ = DSCardFacing::Down )
inline

Spawn a card on top of a target stack

◆ SpawnCard() [2/3]

DSCard DeckStacker.DSCardPool.SpawnCard ( DSStack targetStack_,
DSCardPlacementInDeck placement_,
DSCardFacing facing_ = DSCardFacing::Down )
inline

Spawn a card in target stack. Card placement is defined by DSCardPlacementInDeck.

◆ SpawnCard() [3/3]

DSCard DeckStacker.DSCardPool.SpawnCard ( DSStack targetStack_,
int exactPlacement_,
DSCardFacing facing_ = DSCardFacing::Down )
inline

Spawn a card in target stack at a particular index of the stack's cards list.

Property Documentation

◆ cardManageData

DSCardManagementData DeckStacker.DSCardPool.cardManageData
get

Data attached to this card pool, derived from the card prefab assigned to it.

◆ cardPrefab

DSCard DeckStacker.DSCardPool.cardPrefab
get

The card template used by this pool.

◆ poolCardSpriteAtlas

SpriteAtlas DeckStacker.DSCardPool.poolCardSpriteAtlas
get

The SpriteAtlas that cards managed by this pool update from.


The documentation for this class was generated from the following file: