C# 클래스 EricVoglBattleship.Score2D

Keeps track of the number of ship position possibilities in two dimensions
파일 보기 프로젝트 열기: solium/hacklympics 1 사용 예제들

공개 메소드들

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