C# 클래스 MBC.Controllers.RandomBot_old

상속: MBC.Shared.Controller
파일 보기 프로젝트 열기: aiclub/Mohawk_Battleship

공개 메소드들

메소드 설명
MakeShot ( ) : Shot

This method is called when a shot is available to the controller. The Shot object is a reference to a copy held by the competition and is expected to be modified to the desired target. By default, the Shot receiver is the next controller in the turn.

MatchOver ( ) : void

This method is called when the match has completed. You can use this method in order to export debugging information or any reporting information that your bot has been tracking across all games here.

NewMatch ( ) : void

This method is called when a new match is starting. Note this is not what's called at the start of a round which is an individual game of battleship, a match consists of many rounds, by default 1,000. You can use this method to do some initialization routines for your bot that only need to happen at the start of a match.

NewRound ( ) : void

This method is called from the competition whenever this controller is being involved in a new match-up against a controller, or controllers. This can be treated similarly like a constructor for this controller for simplicity's sake.

OpponentDestroyed ( IDNumber destroyedID ) : void

This method is called when an opponent controller has had all their ships destroyed, and is no longer active in the game.

OpponentShot ( Shot shot ) : void

This method is called each time an opponent controller fires a shot. You can use this method to record the shots your opponent is making against your bot for your own analysis. This information is particularly useful for ship placement strategies.

PlaceShips ( ) : ShipList

This method is called when the controller is required to place ships. It is given a collection of Ship objects that can be accessed.

RoundLost ( ) : void

This method is called when the controller lost the round. You can use this method to output debugging information, or to store information about the game for future analysis.

RoundWon ( ) : void

This method is called when this controller won the round. You can use this method to output debugging information, or to store information about the game for future analysis.

ShotHit ( Shot shot, bool sunk ) : void

This method is called each time a shot made by your bot scores a hit against an enemy ship. This method is useful for updating your bots mapping information. NOTE: the sunk boolean will only let your bot know that a ship has been sunk, it does not indicate which ship has been sunk.

ShotMiss ( Shot shot ) : void

This method is called each time a shot made by your bot misses. This information is useful for updating your bots mapping information.

비공개 메소드들

메소드 설명
NextRandomShot ( ) : Shot

This method gets a random Shot that remains in the shotQueue.

RandomCoordinates ( ) : Coordinates

This method generates a random set of coordinates within the match field boundaries.

RandomShipOrientation ( ) : ShipOrientation

This method randomly returns one of two ShipOrientation enums.

SetShots ( ) : void

This method will create a new ShotList in the shotQueue field of this controller. It will fill this ShotList with shots that this controller has available.

메소드 상세

MakeShot() 공개 메소드

This method is called when a shot is available to the controller. The Shot object is a reference to a copy held by the competition and is expected to be modified to the desired target. By default, the Shot receiver is the next controller in the turn.
public MakeShot ( ) : Shot
리턴 Shot

MatchOver() 공개 메소드

This method is called when the match has completed. You can use this method in order to export debugging information or any reporting information that your bot has been tracking across all games here.
public MatchOver ( ) : void
리턴 void

NewMatch() 공개 메소드

This method is called when a new match is starting. Note this is not what's called at the start of a round which is an individual game of battleship, a match consists of many rounds, by default 1,000. You can use this method to do some initialization routines for your bot that only need to happen at the start of a match.
public NewMatch ( ) : void
리턴 void

NewRound() 공개 메소드

This method is called from the competition whenever this controller is being involved in a new match-up against a controller, or controllers. This can be treated similarly like a constructor for this controller for simplicity's sake.
public NewRound ( ) : void
리턴 void

OpponentDestroyed() 공개 메소드

This method is called when an opponent controller has had all their ships destroyed, and is no longer active in the game.
public OpponentDestroyed ( IDNumber destroyedID ) : void
destroyedID MBC.Shared.IDNumber
리턴 void

OpponentShot() 공개 메소드

This method is called each time an opponent controller fires a shot. You can use this method to record the shots your opponent is making against your bot for your own analysis. This information is particularly useful for ship placement strategies.
public OpponentShot ( Shot shot ) : void
shot Shot
리턴 void

PlaceShips() 공개 메소드

This method is called when the controller is required to place ships. It is given a collection of Ship objects that can be accessed.
public PlaceShips ( ) : ShipList
리턴 ShipList

RoundLost() 공개 메소드

This method is called when the controller lost the round. You can use this method to output debugging information, or to store information about the game for future analysis.
public RoundLost ( ) : void
리턴 void

RoundWon() 공개 메소드

This method is called when this controller won the round. You can use this method to output debugging information, or to store information about the game for future analysis.
public RoundWon ( ) : void
리턴 void

ShotHit() 공개 메소드

This method is called each time a shot made by your bot scores a hit against an enemy ship. This method is useful for updating your bots mapping information. NOTE: the sunk boolean will only let your bot know that a ship has been sunk, it does not indicate which ship has been sunk.
public ShotHit ( Shot shot, bool sunk ) : void
shot Shot The coordinates of the shot that hit
sunk bool Returns true if the shot caused an enemy ship to sink
리턴 void

ShotMiss() 공개 메소드

This method is called each time a shot made by your bot misses. This information is useful for updating your bots mapping information.
public ShotMiss ( Shot shot ) : void
shot Shot The coordinates of the shot that missed.
리턴 void