C# 클래스 BattleshipUtility.BattleshipPlayer

Describes a battleship player
파일 보기 프로젝트 열기: solium/hacklympics 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_log StringBuilder

공개 메소드들

메소드 설명
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

메소드 상세

Cleanup() 공개 메소드

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

Initialize() 공개 메소드

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
리턴 void

Load() 공개 추상적인 메소드

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

Log() 공개 메소드

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
리턴 void

NextTurn() 공개 메소드

Advances to next turn
public NextTurn ( ) : void
리턴 void

Save() 공개 추상적인 메소드

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

프로퍼티 상세

_log 보호되어 있는 프로퍼티

protected StringBuilder _log
리턴 StringBuilder