C# Class BattleshipUtility.BattleshipPlayer

Describes a battleship player
Afficher le fichier Open project: solium/hacklympics Class Usage Examples

Protected Properties

Свойство Type Description
_log StringBuilder

Méthodes publiques

Méthode Description
Cleanup ( GameEndState state ) : void

Cleans up the game

Initialize ( int width, int height, List ships, string opponent ) : void

Creates a player

Load ( ) : void

Loads any saved data about opponents

Log ( string s ) : void

Stores a game log

You can choose to save or process this in your player implementation

NextTurn ( ) : void

Advances to next turn

Save ( GameEndState state ) : void

Saves any gathered data about opponents

Method Details

Cleanup() public méthode

Cleans up the game
public Cleanup ( GameEndState state ) : void
state GameEndState win/lose/tie
Résultat void

Initialize() public méthode

Creates a player
public Initialize ( int width, int height, List ships, string opponent ) : void
width int width of board
height int height of board
ships List ships in use this game
opponent string opponent name
Résultat void

Load() public abstract méthode

Loads any saved data about opponents
public abstract Load ( ) : void
Résultat void

Log() public méthode

Stores a game log
You can choose to save or process this in your player implementation
public Log ( string s ) : void
s string string to log
Résultat void

NextTurn() public méthode

Advances to next turn
public NextTurn ( ) : void
Résultat void

Save() public abstract méthode

Saves any gathered data about opponents
public abstract Save ( GameEndState state ) : void
state GameEndState
Résultat void

Property Details

_log protected_oe property

protected StringBuilder _log
Résultat StringBuilder