Package student.micro.battleship
Class CallShotMove
java.lang.Object
student.micro.battleship.Move
student.micro.battleship.CallShotMove
Represents a "call out a shot" (or make a shot) move in the game
"Battleship". When one player "fires" on another player's board
and specifies the coordinate positions, that action is represented
by an instance of this class.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CallShotMove
public CallShotMove(int x, int y) Creates a new move.- Parameters:
x
- The x-coordinate of the position at which the shot is being fired.y
- The y-coordinate of the position at which the shot is being fired.
-
-
Method Details
-
getX
public int getX()Get the x-coordinate of the position associated with this shot.- Returns:
- The x-coordinate of the position at which this shot was fired.
-
getY
public int getY()Get the y-coordinate of the position associated with this shot.- Returns:
- The y-coordinate of the position at which this shot was fired.
-
equals
-
hashCode
public int hashCode() -
toString
-