Package org.swtpra1.amazongame
Class Turn
- java.lang.Object
-
- org.swtpra1.amazongame.Turn
-
- All Implemented Interfaces:
java.io.Serializable
public class Turn extends java.lang.Object implements java.io.Serializable
This class represents one turn, made by a player. It consists of moving the amazon and then shooting an arrow from its new position.- Version:
- 1.0
- Author:
- Tim Storm
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Turn(int startRow, int startColumn, int endRow, int endColumn, int shotRow, int shotColumn, Player player)
A convenience wrapper to construct a turn with coodinates.Turn(Square moveStart, Square moveEnd, Square shot, Player player)
Constructs a turn from one Square to another Square.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
org.swtpra1.amazongame.Turn.Move
getMove()
Square
getMoveEnd()
Square
getMoveStart()
Player
getPlayer()
int
getPlayerId()
Square
getShot()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Turn
public Turn(Square moveStart, Square moveEnd, Square shot, Player player)
Constructs a turn from one Square to another Square.- Parameters:
moveStart
- the Square the move is starting onmoveEnd
- the Square the move ends onshot
- the Square where an arrow is shot after the moveplayer
- the Player executing the turn
-
Turn
public Turn(int startRow, int startColumn, int endRow, int endColumn, int shotRow, int shotColumn, Player player)
A convenience wrapper to construct a turn with coodinates.- Parameters:
startRow
- the row of the starting positionstartColumn
- the column of the starting positionendRow
- the row of the ending positionendColumn
- the column of the ending positionshotRow
- the row of the shot targetshotColumn
- the column of the shot targetplayer
- the Player executing the turn
-
-
Method Detail
-
getPlayer
public Player getPlayer()
-
getPlayerId
public int getPlayerId()
-
getShot
public Square getShot()
-
getMoveStart
public Square getMoveStart()
-
getMoveEnd
public Square getMoveEnd()
-
getMove
public org.swtpra1.amazongame.Turn.Move getMove()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-