C# Class EricVoglBattleship.Score2D

Keeps track of the number of ship position possibilities in two dimensions
Afficher le fichier Open project: solium/hacklympics Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat void

ApplyVerticalScore() public méthode

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
Résultat void

Clear() public méthode

Clears the score
public Clear ( ) : void
Résultat void

InitializeHorizontalScore() public méthode

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
Résultat void

InitializeVerticalScore() public méthode

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
Résultat void

Recalculate() public méthode

Forces a recalculation of the total score
public Recalculate ( ) : void
Résultat void

Sink() public méthode

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