C# Class HearthAnalyzer.Core.Cards.Deck

Represents a deck of cards
Mostrar archivo Open project: kwluo90/HearthAnalyzer Class Usage Examples

Public Properties

Property Type Description
Cards List

Private Properties

Property Type Description

Public Methods

Method 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 method

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
return void

AddCards() public method

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
return void

Deck() public method

Initialize a new empty deck
public Deck ( ) : System
return System

Deck() public method

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

DrawCard() public method

Draws a card from the player's deck
public DrawCard ( ) : BaseCard
return BaseCard

DrawCards() public method

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

FromDeckFile() public static method

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
return Deck

Shuffle() public method

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

Property Details

Cards public_oe property

public List Cards
return List