C# Класс HearthAnalyzer.Core.Cards.Deck

Represents a deck of cards
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Cards List

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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

Описание методов

AddCard() публичный Метод

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
Результат void

AddCards() публичный Метод

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
Результат void

Deck() публичный Метод

Initialize a new empty deck
public Deck ( ) : System
Результат System

Deck() публичный Метод

Initialize a deck with a list of cards
public Deck ( List cards ) : System
cards List The cards to fill the deck with
Результат System

DrawCard() публичный Метод

Draws a card from the player's deck
public DrawCard ( ) : BaseCard
Результат BaseCard

DrawCards() публичный Метод

Draws n cards
public DrawCards ( int n = 1 ) : List
n int The number of cards to draw
Результат List

FromDeckFile() публичный статический Метод

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
Результат Deck

Shuffle() публичный Метод

Shuffle the deck
public Shuffle ( int n = 5 ) : void
n int The number of times to shuffle the deck
Результат void

Описание свойств

Cards публичное свойство

public List Cards
Результат List