almost same as isSelected, understanding that i need to playwith
coordinates in if statements
This commit is contained in:
parent
2f327e8af7
commit
3164fcde7c
|
|
@ -127,6 +127,7 @@ public class Board {
|
|||
if(setSelectXY(x,y) == true) { // checks for pieces at the position x and y
|
||||
selectX = x; //set select x to x
|
||||
selectY = y; // same with y
|
||||
isHighlighted(x,y);
|
||||
}
|
||||
}else { //if select x and y arent at their initial value (means that a piece is selected in the grid)
|
||||
|
||||
|
|
@ -177,15 +178,17 @@ public class Board {
|
|||
|
||||
public Board(String[] array) {
|
||||
//TODO
|
||||
|
||||
}
|
||||
|
||||
/* The following methods require more work ! */
|
||||
|
||||
public boolean isHighlighted(int x, int y) {
|
||||
boolean isAPieceHere = setSelectXY(x,y);
|
||||
boolean isAPieceHere = false ;
|
||||
if(selectX == x+1 && selectY == y+1) {
|
||||
isAPieceHere = true;
|
||||
}
|
||||
return isAPieceHere;
|
||||
}
|
||||
}
|
||||
|
||||
public void undoLastMove() {
|
||||
//TODO
|
||||
|
|
|
|||
Loading…
Reference in New Issue