C# Класс HearthAnalyzer.Core.GameEngine

Represents the game engine and game loop for Hearthstone
Показать файл Открыть проект

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

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

Private Properties

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

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

Метод Описание
ApplyAttackDamage ( IAttacker attacker, IDamageableEntity target, bool isRetaliation = false ) : void

Apply damage from the attacker to the target

CheckForGameEnd ( ) : bool

Checks to see if the game has ended

DealPreMulligan ( ) : void

Shuffles and deals the pre-mulligan hands

EndTurn ( ) : void

Ends the turn for the current player

Initialize ( BasePlayer player, BasePlayer opponent, GameBoard board = null, int turnNumber, BasePlayer currentPlayer = null, int randomSeed ) : void

Initialize the game engine

MoveCard ( int id, Zones srcZone, int srcPos, Zones destZone, int destPos ) : void

Moves a card from one zone position to another zone position

Mulligan ( BasePlayer player, IEnumerable mulligans ) : void

Performs a mulligan for the specified player

RegisterDeathrattle ( BaseCard source, BaseDeathrattle baseDeathrattle ) : void

Register a baseDeathrattle with the game engine. If the source card dies, it will trigger.

StartTurn ( BasePlayer player ) : void

Starts a turn for the specified player

TriggerDeathrattles ( ) : void

Triggers death rattles after damage has been calculated.

Uninitialize ( ) : void

Uninitializes the game engine

UnregisterDeathrattle ( BaseMinion source ) : void

Removes all deathrattles registered by the source card.

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

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

Apply damage from the attacker to the target
public static ApplyAttackDamage ( IAttacker attacker, IDamageableEntity target, bool isRetaliation = false ) : void
attacker IAttacker The card doing the attacking
target IDamageableEntity The object receiving the attack
isRetaliation bool Whether or not the attack is a retaliation
Результат void

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

Checks to see if the game has ended
public static CheckForGameEnd ( ) : bool
Результат bool

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

Shuffles and deals the pre-mulligan hands
public static DealPreMulligan ( ) : void
Результат void

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

Ends the turn for the current player
public static EndTurn ( ) : void
Результат void

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

Initialize the game engine
public static Initialize ( BasePlayer player, BasePlayer opponent, GameBoard board = null, int turnNumber, BasePlayer currentPlayer = null, int randomSeed ) : void
player BasePlayer Player 1
opponent BasePlayer Player 2 (the opponent)
board GameBoard The current game board
turnNumber int The current turn number
currentPlayer BasePlayer The current player
randomSeed int The random seed to use
Результат void

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

Moves a card from one zone position to another zone position
public static MoveCard ( int id, Zones srcZone, int srcPos, Zones destZone, int destPos ) : void
id int The card to move
srcZone Zones The source zone
srcPos int The source position
destZone Zones The destination zone
destPos int The destination position
Результат void

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

Performs a mulligan for the specified player
public static Mulligan ( BasePlayer player, IEnumerable mulligans ) : void
player BasePlayer The player performing the mulligan
mulligans IEnumerable The cards to toss if any
Результат void

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

Register a baseDeathrattle with the game engine. If the source card dies, it will trigger.
public static RegisterDeathrattle ( BaseCard source, BaseDeathrattle baseDeathrattle ) : void
source BaseCard The triggering card
baseDeathrattle HearthAnalyzer.Core.Deathrattles.BaseDeathrattle The baseDeathrattle to perform
Результат void

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

Starts a turn for the specified player
public static StartTurn ( BasePlayer player ) : void
player BasePlayer The player who is starting their turn
Результат void

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

Triggers death rattles after damage has been calculated.
public static TriggerDeathrattles ( ) : void
Результат void

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

Uninitializes the game engine
public static Uninitialize ( ) : void
Результат void

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

Removes all deathrattles registered by the source card.
public static UnregisterDeathrattle ( BaseMinion source ) : void
source HearthAnalyzer.Core.Cards.BaseMinion The triggering card
Результат void

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

GameEnded публичное статическое свойство

The event that gets fired when the game is over
public static GameEndedEventHandler GameEnded
Результат GameEndedEventHandler