C# Class EricVoglBattleship.Score2D

Keeps track of the number of ship position possibilities in two dimensions
显示文件 Open project: solium/hacklympics Class Usage Examples

Public Methods

Method Description
ApplyHorizontalScore ( List ships, int index, int length ) : void

Applies a score to the horizontal dimension

ApplyVerticalScore ( List ships, int index, int length ) : void

Applies a score to the vertical dimension

Clear ( ) : void

Clears the score

InitializeHorizontalScore ( List ships, int index, int length ) : void

Initializes the horizontal dimension

InitializeVerticalScore ( List ships, int index, int length ) : void

Initializes the vertical dimension

Recalculate ( ) : void

Forces a recalculation of the total score

Sink ( int size ) : void

Adjusts score based on the fact that a ship has sunk

Method Details

ApplyHorizontalScore() public method

Applies a score to the horizontal dimension
public ApplyHorizontalScore ( List ships, int index, int length ) : void
ships List ships alive
index int index within length
length int length
return void

ApplyVerticalScore() public method

Applies a score to the vertical dimension
public ApplyVerticalScore ( List ships, int index, int length ) : void
ships List ships alive
index int index within length
length int length
return void

Clear() public method

Clears the score
public Clear ( ) : void
return void

InitializeHorizontalScore() public method

Initializes the horizontal dimension
public InitializeHorizontalScore ( List ships, int index, int length ) : void
ships List ships in game
index int index within length
length int length
return void

InitializeVerticalScore() public method

Initializes the vertical dimension
public InitializeVerticalScore ( List ships, int index, int length ) : void
ships List ships in game
index int index within length
length int length
return void

Recalculate() public method

Forces a recalculation of the total score
public Recalculate ( ) : void
return void

Sink() public method

Adjusts score based on the fact that a ship has sunk
public Sink ( int size ) : void
size int The size of ship that sank
return void