Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A class representing a position in the game
- public class Position {
- private int row;
- private int col;
- public Position(int row, int col) {
- this.row = row;
- this.col = col;
- }
- public int getRow() {
- return row;
- }
- public int getCol() {
- return col;
- }
- public boolean equals(Position otherLoc) {
- return row == otherLoc.getRow() && col == otherLoc.getCol();
- }
- public String toString() {
- return "(" + row + ", " + col + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement