Class ScriptableDeckList
Mimics the behavior of a deck of cards. You have the main deck, the discarded cards and the cards in hand.
Inherited Members
Namespace: AutoBattleFramework.Shop.ShopList
Assembly: cs.temp.dll.dll
Syntax
public class ScriptableDeckList : IShopList
Fields
CardsInHand
Cards currently in hand (shown in the store interface).
Declaration
public List<ShopItemInfo> CardsInHand
Field Value
Type | Description |
---|---|
List<ShopItemInfo> |
DeckList
Cards currently in the deck.
Declaration
public List<ShopItemInfo> DeckList
Field Value
Type | Description |
---|---|
List<ShopItemInfo> |
DiscardList
Cards that have been played or discarded.
Declaration
public List<ShopItemInfo> DiscardList
Field Value
Type | Description |
---|---|
List<ShopItemInfo> |
RemovedItems
Cards removed from the deck.
Declaration
public List<ShopItemInfo> RemovedItems
Field Value
Type | Description |
---|---|
List<ShopItemInfo> |
Methods
AddItemInfo(ShopItemInfo)
Adds a card to the deck
Declaration
public override ShopItemInfo AddItemInfo(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Card to be added |
Returns
Type | Description |
---|---|
ShopItemInfo | The added card |
Overrides
Backup()
Makes a backup of the deck. Prevents the ScriptableObject from being overwritten.
Declaration
public override IShopList Backup()
Returns
Type | Description |
---|---|
IShopList | Backed deck. |
Overrides
Draw(List<ShopItemInfo>, Boolean)
Draw a card from the deck. Add it to a list.
Declaration
public override ShopItemInfo Draw(List<ShopItemInfo> items, bool RepeatItems)
Parameters
Type | Name | Description |
---|---|---|
List<ShopItemInfo> | items | List where the card will be added. |
Boolean | RepeatItems | Not used in this case. |
Returns
Type | Description |
---|---|
ShopItemInfo | Drawn card. |
Overrides
GetRandomItems(Int32, Boolean)
Discards all cards in hand and draws a number of cards from the deck.
Declaration
public override List<ShopItemInfo> GetRandomItems(int numberOfItems, bool RepeatItems)
Parameters
Type | Name | Description |
---|---|---|
Int32 | numberOfItems | Number of cards to be drawn. |
Boolean | RepeatItems | In this case it is not used. |
Returns
Type | Description |
---|---|
List<ShopItemInfo> |
Overrides
Initialize()
Initializes all variables.
Declaration
public override void Initialize()
Overrides
ModifyGameActor(GameActor)
Modify the stats of a GameActor.
Declaration
public override void ModifyGameActor(GameActor actor)
Parameters
Type | Name | Description |
---|---|---|
GameActor | actor | GameActor to modify |
Overrides
OnBuy(ShopItemInfo)
When the card is bought, the card is discarded.
Declaration
public override void OnBuy(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Bought card. |
Overrides
RemoveItemInfo(ShopItemInfo)
Remove a card from the deck.
Declaration
public override bool RemoveItemInfo(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Card to be removed |
Returns
Type | Description |
---|---|
Boolean | If card removal has been successful |
Overrides
RestoreItemInfo(ScriptableShopItem)
Restore a ShopItemInfo that has been bought before. Returns true if successful.
Declaration
public override bool RestoreItemInfo(ScriptableShopItem info)
Parameters
Type | Name | Description |
---|---|---|
ScriptableShopItem | info | Item to be restored. |
Returns
Type | Description |
---|---|
Boolean | True if succesful |
Overrides
Shuffle(List<ShopItemInfo>)
Shuffle a list of cards
Declaration
public void Shuffle(List<ShopItemInfo> list)
Parameters
Type | Name | Description |
---|---|---|
List<ShopItemInfo> | list | Cards to be shuffled |