C# Class BattleshipUtility.BattleshipPlayer

Describes a battleship player
Show file Open project: solium/hacklympics Class Usage Examples

Protected Properties

Property Type Description
_log StringBuilder

Public Methods

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

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

Initialize() public method

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

Load() public abstract method

Loads any saved data about opponents
public abstract Load ( ) : void
return void

Log() public method

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

NextTurn() public method

Advances to next turn
public NextTurn ( ) : void
return void

Save() public abstract method

Saves any gathered data about opponents
public abstract Save ( GameEndState state ) : void
state GameEndState
return void

Property Details

_log protected property

protected StringBuilder _log
return StringBuilder