- canTake([x1,y1], [x2,y2])
- {
- const piece1 = this.getPiece(x1,y1);
- const piece2 = this.getPiece(x2,y2);
- const color1 = this.getColor(x1,y1);
- const color2 = this.getColor(x2,y2);
- return piece2 != "a" &&
- ((piece1 != "a" && color1 != color2) || (piece1 == "a" && color1 == color2));
+ canTake([x1, y1], [x2, y2]) {
+ const piece1 = this.getPiece(x1, y1);
+ const piece2 = this.getPiece(x2, y2);
+ const color1 = this.getColor(x1, y1);
+ const color2 = this.getColor(x2, y2);
+ return (
+ piece2 != "a" &&
+ ((piece1 != "a" && color1 != color2) ||
+ (piece1 == "a" && color1 == color2))
+ );