Package org.progettoedids.util
Class Position
java.lang.Object
org.progettoedids.util.Position
This is a generic class to hold a pair of integers which represent a 2D position with coordinates x and y.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
x
public int x -
y
public int y
-
-
Constructor Details
-
Position
public Position(int x, int y)
-
-
Method Details
-
nextPositionInDirection
Returns the adjacent Position in a certain Direction- Parameters:
direction- A Direction. Must not be null- Returns:
- the next Position to the one of this Position
- Throws:
IllegalArgumentException- if the Direction provided as an argument is invalid
-
equals
-
hashCode
-