C# 클래스 MBC.Shared.Entities.Ship

상속: System.Entity
파일 보기 프로젝트 열기: aiclub/Mohawk_Battleship 1 사용 예제들

공개 메소드들

메소드 설명
ConflictsWith ( Ship otherShip ) : bool

Checks if another Ship occupies any cells that this Ship occupies.

Hit ( Coordinates coords ) : void

Hits the ship at the coordinates.

IsAt ( Coordinates location ) : bool

Indicates whether or not a location is an occupied cell.

IsHitAt ( Coordinates location ) : bool

Checks whether the hit flag has been set at the specific ship location index.

IsSunk ( ) : bool

Place ( Coordinates location, ShipOrientation orientation ) : void

Places this Ship with the location and orientation. Sets the state of being placed to true.

Reset ( ) : void

Resets the ship back to its initialized state.

Ship ( System.Entity parent, int length ) : System

Sets the length of the Ship to length. The length must be at least 1.

Ship ( Ship shipCopy ) : System

Copies an existing Ship.

Sink ( ) : void

Sinks the ship

ToString ( ) : string

Provides a string representation.

비공개 메소드들

메소드 설명
GetAllLocations ( ) : IEnumerable

메소드 상세

ConflictsWith() 공개 메소드

Checks if another Ship occupies any cells that this Ship occupies.
public ConflictsWith ( Ship otherShip ) : bool
otherShip Ship The to check for confliction with.
리턴 bool

Hit() 공개 메소드

Hits the ship at the coordinates.
public Hit ( Coordinates coords ) : void
coords Coordinates
리턴 void

IsAt() 공개 메소드

Indicates whether or not a location is an occupied cell.
public IsAt ( Coordinates location ) : bool
location Coordinates The of the location to check.
리턴 bool

IsHitAt() 공개 메소드

Checks whether the hit flag has been set at the specific ship location index.
public IsHitAt ( Coordinates location ) : bool
location Coordinates
리턴 bool

IsSunk() 공개 메소드

public IsSunk ( ) : bool
리턴 bool

Place() 공개 메소드

Places this Ship with the location and orientation. Sets the state of being placed to true.
public Place ( Coordinates location, ShipOrientation orientation ) : void
location Coordinates The of the bottom-most/left-most part of /// the .
orientation ShipOrientation The to set.
리턴 void

Reset() 공개 메소드

Resets the ship back to its initialized state.
public Reset ( ) : void
리턴 void

Ship() 공개 메소드

Sets the length of the Ship to length. The length must be at least 1.
Thrown when the is less /// than 1.
public Ship ( System.Entity parent, int length ) : System
parent System.Entity
length int The number of cells the occupies.
리턴 System

Ship() 공개 메소드

Copies an existing Ship.
public Ship ( Ship shipCopy ) : System
shipCopy Ship
리턴 System

Sink() 공개 메소드

Sinks the ship
public Sink ( ) : void
리턴 void

ToString() 공개 메소드

Provides a string representation.
public ToString ( ) : string
리턴 string