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

Public Member Functions

void AddCard (DSCard newCard_)
 
void AddCard (DSCard newCard_, DSCardPlacementInDeck placement_)
 
void AddCard (DSCard newCard_, int exactPlacement_)
 
void RemoveCard (DSCard removingCard_)
 
int RandomMiddleDeckPlacement ()
 
void ReorderCardInStack (DSCard reorderingCard_, int newIndex_)
 
void ReorderCardInStack (DSCard reorderingCard_, DSCardPlacementInDeck newPlacement_)
 
void ShiftCardOrder (DSCard reorderingCard_, int howManyPositions_)
 
void UpdateCardRenderOrder ()
 

Properties

List< DSCardcards [get, set]
 
bool cardsAreGrabbable [get, set]
 
RectTransform cardStackParent [get]
 
bool enableGrabReordering [get, set]
 
DSCardFacing facing [get, set]
 

Detailed Description

This script contains code for adding, removing, and reordering cards in a stack.

General notes on Stacks

  • Top of the deck is cards[cards.LastIndex()]
  • Bottom of the deck is cards[0].

Member Function Documentation

◆ AddCard() [1/3]

void DeckStacker.DSCardManager.AddCard ( DSCard newCard_)
inline

Adds a specified card to the stack. Default card placement is the top of the deck (last in cards list).

◆ AddCard() [2/3]

void DeckStacker.DSCardManager.AddCard ( DSCard newCard_,
DSCardPlacementInDeck placement_ )
inline

Adds a specified card to the stack. This overload will allow an enum expression to dictate where a card is placed in a stack.

◆ AddCard() [3/3]

void DeckStacker.DSCardManager.AddCard ( DSCard newCard_,
int exactPlacement_ )
inline

Adds a specified card to the stack. This overload allows for adding the card to a specific index in the stack.

◆ RandomMiddleDeckPlacement()

int DeckStacker.DSCardManager.RandomMiddleDeckPlacement ( )
inline

Returns a cards index that is in between the top and bottom card.

◆ RemoveCard()

void DeckStacker.DSCardManager.RemoveCard ( DSCard removingCard_)
inline

Removes the specified card from being tracked by the stack.

◆ ReorderCardInStack() [1/2]

void DeckStacker.DSCardManager.ReorderCardInStack ( DSCard reorderingCard_,
DSCardPlacementInDeck newPlacement_ )
inline

For moving a single card to another position in the stack.
This overload is for using DSCardPlacementInDeck.

◆ ReorderCardInStack() [2/2]

void DeckStacker.DSCardManager.ReorderCardInStack ( DSCard reorderingCard_,
int newIndex_ )
inline

For moving a single card to another position in the stack.

◆ ShiftCardOrder()

void DeckStacker.DSCardManager.ShiftCardOrder ( DSCard reorderingCard_,
int howManyPositions_ )
inline

Moves the specified card's order up or down the stack by howManyPositions_ positions.

◆ UpdateCardRenderOrder()

void DeckStacker.DSCardManager.UpdateCardRenderOrder ( )
inline

Update the sibling index of all cards to match the order they appear in the cards list.

Property Documentation

◆ cards

List<DSCard> DeckStacker.DSCardManager.cards
getset

This list is a record of what cards belong to this stack.
Index order in this list will also determine card order, and sibling order of the card objects in this stack.

◆ cardsAreGrabbable

bool DeckStacker.DSCardManager.cardsAreGrabbable
getset

This flag allows cards in this stack to be "grabbable". See DSCardGrabber.

◆ cardStackParent

RectTransform DeckStacker.DSCardManager.cardStackParent
get

This object is the direct parent of any cards in this stack.
This also determines the bounding box of the stack (involved in overstuffed stack calculations).

◆ enableGrabReordering

bool DeckStacker.DSCardManager.enableGrabReordering
getset

This will enable the player to reorder a card through grabbing cards and pulling them around.

◆ facing

DSCardFacing DeckStacker.DSCardManager.facing
getset

Can be Up, Down, and Mixed to designate the flipped orientation of cards in this deck.
Changing this enum between Up and Down will tell DSCardFlipper to trigger a card flip.


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