C# Class HearthAnalyzer.Core.GameEngine

Represents the game engine and game loop for Hearthstone
ファイルを表示 Open project: kwluo90/HearthAnalyzer

Public Properties

Property Type Description
GameEnded GameEndedEventHandler

Private Properties

Property Type Description

Public Methods

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

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

CheckForGameEnd() public static method

Checks to see if the game has ended
public static CheckForGameEnd ( ) : bool
return bool

DealPreMulligan() public static method

Shuffles and deals the pre-mulligan hands
public static DealPreMulligan ( ) : void
return void

EndTurn() public static method

Ends the turn for the current player
public static EndTurn ( ) : void
return void

Initialize() public static method

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

MoveCard() public static method

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

Mulligan() public static method

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

RegisterDeathrattle() public static method

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

StartTurn() public static method

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

TriggerDeathrattles() public static method

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

Uninitialize() public static method

Uninitializes the game engine
public static Uninitialize ( ) : void
return void

UnregisterDeathrattle() public static method

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

Property Details

GameEnded public_oe static_oe property

The event that gets fired when the game is over
public static GameEndedEventHandler GameEnded
return GameEndedEventHandler