C# Class GR.Gambling.Backgammon.Venue.BGGameWindow

Show file Open project: alexhanh/Botting-Library Class Usage Examples

Protected Properties

Property Type Description
client BGClient
window GR.Win32.Window

Public Methods

Method Description
BGGameWindow ( Window window, BGClient client ) : System
Capture ( ) : Bitmap
Chat ( string text ) : void

Writes a chat message to the game window chat.

Done ( ) : bool

Finish the current move turn.

Double ( ) : bool

Offer a double.

GetGameState ( ) : GameState
GetGameState ( Bitmap bitmap ) : GameState
GetHashCode ( ) : int
Leave ( ) : bool

Close and leave the table.

MakeMove ( Move move, GameState gamestate ) : void
Rake ( int player, int points ) : int
Resign ( GameState gamestate, ResignValue resign_value ) : bool

Offer a resign for a given value.

RespondToDouble ( DoubleResponse double_response ) : bool

Respond back to a double offer.

RespondToRematch ( bool accept ) : bool

Respond back to a rematch offer.

RespondToResign ( ResignResponse resign_response ) : bool

Respond back to a resign offer.

Roll ( ) : bool

Roll the dice.

ToString ( ) : string
Undo ( ) : void

This will undo last or undo all depending on which one is supported by the venue.

Update ( ) : void

Checks the window and game status and raises the according events. Notice, the events are designed to support scenarios where one of the players is the observer.

Protected Methods

Method Description
OnChatMessage ( string message ) : void
OnDiceRolled ( GameState gamestate ) : void
OnDiceRolled ( GameState gamestate, System.DateTime stamp ) : void
OnDoubleOffered ( GameState gamestate ) : void
OnDoubleOffered ( GameState gamestate, System.DateTime stamp ) : void
OnNewGameStarted ( GameState gamestate ) : void
OnNewGameStarted ( GameState gamestate, System.DateTime stamp ) : void
OnOppDiceRolled ( int dice, bool opening_roll ) : void
OnRematchOffered ( ) : void
OnResignOfferDeclined ( ) : void
OnResignOffered ( ResignValue resign_value ) : void
OnResignOffered ( ResignValue resign_value, System.DateTime stamp ) : void
OnSessionEnded ( ) : void
OnTimeout ( ) : void
OnTurnChanged ( GameState gamestate ) : void
OnTurnChanged ( GameState gamestate, System.DateTime stamp ) : void

Method Details

BGGameWindow() public method

public BGGameWindow ( Window window, BGClient client ) : System
window GR.Win32.Window
client BGClient
return System

Capture() public method

public Capture ( ) : Bitmap
return System.Drawing.Bitmap

Chat() public abstract method

Writes a chat message to the game window chat.
public abstract Chat ( string text ) : void
text string Text to write.
return void

Done() public abstract method

Finish the current move turn.
public abstract Done ( ) : bool
return bool

Double() public abstract method

Offer a double.
public abstract Double ( ) : bool
return bool

GetGameState() public method

public GetGameState ( ) : GameState
return GameState

GetGameState() public abstract method

public abstract GetGameState ( Bitmap bitmap ) : GameState
bitmap System.Drawing.Bitmap
return GameState

GetHashCode() public method

public GetHashCode ( ) : int
return int

Leave() public abstract method

Close and leave the table.
public abstract Leave ( ) : bool
return bool

MakeMove() public abstract method

public abstract MakeMove ( Move move, GameState gamestate ) : void
move Move
gamestate GameState
return void

OnChatMessage() protected method

protected OnChatMessage ( string message ) : void
message string
return void

OnDiceRolled() protected method

protected OnDiceRolled ( GameState gamestate ) : void
gamestate GameState
return void

OnDiceRolled() protected method

protected OnDiceRolled ( GameState gamestate, System.DateTime stamp ) : void
gamestate GameState
stamp System.DateTime
return void

OnDoubleOffered() protected method

protected OnDoubleOffered ( GameState gamestate ) : void
gamestate GameState
return void

OnDoubleOffered() protected method

protected OnDoubleOffered ( GameState gamestate, System.DateTime stamp ) : void
gamestate GameState
stamp System.DateTime
return void

OnNewGameStarted() protected method

protected OnNewGameStarted ( GameState gamestate ) : void
gamestate GameState
return void

OnNewGameStarted() protected method

protected OnNewGameStarted ( GameState gamestate, System.DateTime stamp ) : void
gamestate GameState
stamp System.DateTime
return void

OnOppDiceRolled() protected method

protected OnOppDiceRolled ( int dice, bool opening_roll ) : void
dice int
opening_roll bool
return void

OnRematchOffered() protected method

protected OnRematchOffered ( ) : void
return void

OnResignOfferDeclined() protected method

protected OnResignOfferDeclined ( ) : void
return void

OnResignOffered() protected method

protected OnResignOffered ( ResignValue resign_value ) : void
resign_value ResignValue
return void

OnResignOffered() protected method

protected OnResignOffered ( ResignValue resign_value, System.DateTime stamp ) : void
resign_value ResignValue
stamp System.DateTime
return void

OnSessionEnded() protected method

protected OnSessionEnded ( ) : void
return void

OnTimeout() protected method

protected OnTimeout ( ) : void
return void

OnTurnChanged() protected method

protected OnTurnChanged ( GameState gamestate ) : void
gamestate GameState
return void

OnTurnChanged() protected method

protected OnTurnChanged ( GameState gamestate, System.DateTime stamp ) : void
gamestate GameState
stamp System.DateTime
return void

Rake() public method

public Rake ( int player, int points ) : int
player int
points int
return int

Resign() public abstract method

Offer a resign for a given value.
public abstract Resign ( GameState gamestate, ResignValue resign_value ) : bool
gamestate GameState
resign_value ResignValue
return bool

RespondToDouble() public abstract method

Respond back to a double offer.
public abstract RespondToDouble ( DoubleResponse double_response ) : bool
double_response DoubleResponse
return bool

RespondToRematch() public abstract method

Respond back to a rematch offer.
public abstract RespondToRematch ( bool accept ) : bool
accept bool
return bool

RespondToResign() public abstract method

Respond back to a resign offer.
public abstract RespondToResign ( ResignResponse resign_response ) : bool
resign_response ResignResponse
return bool

Roll() public abstract method

Roll the dice.
public abstract Roll ( ) : bool
return bool

ToString() public method

public ToString ( ) : string
return string

Undo() public abstract method

This will undo last or undo all depending on which one is supported by the venue.
public abstract Undo ( ) : void
return void

Update() public abstract method

Checks the window and game status and raises the according events. Notice, the events are designed to support scenarios where one of the players is the observer.
public abstract Update ( ) : void
return void

Property Details

client protected property

protected BGClient,GR.Gambling.Backgammon.Venue client
return BGClient

window protected property

protected Window,GR.Win32 window
return GR.Win32.Window