C# Класс EricVoglBattleship.Score2D

Keeps track of the number of ship position possibilities in two dimensions
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

ApplyHorizontalScore() публичный Метод

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
Результат void

ApplyVerticalScore() публичный Метод

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
Результат void

Clear() публичный Метод

Clears the score
public Clear ( ) : void
Результат void

InitializeHorizontalScore() публичный Метод

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
Результат void

InitializeVerticalScore() публичный Метод

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
Результат void

Recalculate() публичный Метод

Forces a recalculation of the total score
public Recalculate ( ) : void
Результат void

Sink() публичный Метод

Adjusts score based on the fact that a ship has sunk
public Sink ( int size ) : void
size int The size of ship that sank
Результат void