C# Class HearthAnalyzer.Core.GameEngine

Represents the game engine and game loop for Hearthstone
Afficher le fichier Open project: kwluo90/HearthAnalyzer

Méthodes publiques

Свойство Type Description
GameEnded GameEndedEventHandler

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
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.

Method Details

ApplyAttackDamage() public static méthode

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
Résultat void

CheckForGameEnd() public static méthode

Checks to see if the game has ended
public static CheckForGameEnd ( ) : bool
Résultat bool

DealPreMulligan() public static méthode

Shuffles and deals the pre-mulligan hands
public static DealPreMulligan ( ) : void
Résultat void

EndTurn() public static méthode

Ends the turn for the current player
public static EndTurn ( ) : void
Résultat void

Initialize() public static méthode

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
Résultat void

MoveCard() public static méthode

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
Résultat void

Mulligan() public static méthode

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
Résultat void

RegisterDeathrattle() public static méthode

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
Résultat void

StartTurn() public static méthode

Starts a turn for the specified player
public static StartTurn ( BasePlayer player ) : void
player BasePlayer The player who is starting their turn
Résultat void

TriggerDeathrattles() public static méthode

Triggers death rattles after damage has been calculated.
public static TriggerDeathrattles ( ) : void
Résultat void

Uninitialize() public static méthode

Uninitializes the game engine
public static Uninitialize ( ) : void
Résultat void

UnregisterDeathrattle() public static méthode

Removes all deathrattles registered by the source card.
public static UnregisterDeathrattle ( BaseMinion source ) : void
source HearthAnalyzer.Core.Cards.BaseMinion The triggering card
Résultat void

Property Details

GameEnded public_oe static_oe property

The event that gets fired when the game is over
public static GameEndedEventHandler GameEnded
Résultat GameEndedEventHandler