C# Class HearthAnalyzer.Core.Cards.Deck

Represents a deck of cards
Afficher le fichier Open project: kwluo90/HearthAnalyzer Class Usage Examples

Méthodes publiques

Свойство Type Description
Cards List

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
AddCard ( BaseCard card ) : void

Adds a card to the current deck

Adds to the end of the deck by default

AddCards ( IEnumerable cards ) : void

Adds a list of cards to the current deck

Adds to the end of the deck by default

Deck ( ) : System

Initialize a new empty deck

Deck ( List cards ) : System

Initialize a deck with a list of cards

DrawCard ( ) : BaseCard

Draws a card from the player's deck

DrawCards ( int n = 1 ) : List

Draws n cards

FromDeckFile ( string pathToFile ) : Deck

Creates a deck from a deck file

A deck file follows the following format: [count], [card name] with each card on a separate line

Shuffle ( int n = 5 ) : void

Shuffle the deck

Method Details

AddCard() public méthode

Adds a card to the current deck
Adds to the end of the deck by default
public AddCard ( BaseCard card ) : void
card BaseCard The card to add
Résultat void

AddCards() public méthode

Adds a list of cards to the current deck
Adds to the end of the deck by default
public AddCards ( IEnumerable cards ) : void
cards IEnumerable The list of cards to add
Résultat void

Deck() public méthode

Initialize a new empty deck
public Deck ( ) : System
Résultat System

Deck() public méthode

Initialize a deck with a list of cards
public Deck ( List cards ) : System
cards List The cards to fill the deck with
Résultat System

DrawCard() public méthode

Draws a card from the player's deck
public DrawCard ( ) : BaseCard
Résultat BaseCard

DrawCards() public méthode

Draws n cards
public DrawCards ( int n = 1 ) : List
n int The number of cards to draw
Résultat List

FromDeckFile() public static méthode

Creates a deck from a deck file
A deck file follows the following format: [count], [card name] with each card on a separate line
public static FromDeckFile ( string pathToFile ) : Deck
pathToFile string Path to the deck file
Résultat Deck

Shuffle() public méthode

Shuffle the deck
public Shuffle ( int n = 5 ) : void
n int The number of times to shuffle the deck
Résultat void

Property Details

Cards public_oe property

public List Cards
Résultat List