Last change
on this file since 57 was
44,
checked in by mszubert, 15 years ago
|
cecj, framsticks and games packages imported
|
File size:
584 bytes
|
Rev | Line | |
---|
[44] | 1 | package cecj.app.othello; |
---|
| 2 | |
---|
| 3 | import games.GameMove; |
---|
| 4 | |
---|
| 5 | public class OthelloMove implements GameMove { |
---|
| 6 | private int row; |
---|
| 7 | private int col; |
---|
| 8 | |
---|
| 9 | public OthelloMove(int row, int col) { |
---|
| 10 | this.row = row; |
---|
| 11 | this.col = col; |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | public int getRow() { |
---|
| 15 | return row; |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | public int getCol() { |
---|
| 19 | return col; |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | @Override |
---|
| 23 | public boolean equals(Object obj) { |
---|
| 24 | if (!(obj instanceof OthelloMove)) |
---|
| 25 | return false; |
---|
| 26 | OthelloMove move = (OthelloMove) obj; |
---|
| 27 | return (this.row == move.row && this.col == move.col); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | @Override |
---|
| 31 | public String toString() { |
---|
| 32 | return "(" + row + ", " + col + ")"; |
---|
| 33 | } |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.