Commit afb08304 authored by Jan Rossmeisl's avatar Jan Rossmeisl
Browse files

deleted Functions class

parent 6f394138
......@@ -10,7 +10,6 @@ public class ActionHandler {
FileHandler fileHandler;
public ActionHandler(ActionEvent e, Field field, int x, int y) {
Functions functions = new Functions(e);
fileHandler = new FileHandler("Move.txt");
this.field = field;
this.coordX = x;
......@@ -46,7 +45,7 @@ public class ActionHandler {
}
// click 1
} else if (functions.checkType(e)) { // check if button is a -chess piece- or an -empty field-
} else if (e.getSource() instanceof ChessPiece) { // check if button is a -chess piece- or an -empty field-
// chess piece
ChessPiece chessPiece = (ChessPiece) e.getSource();
......
package application;
import java.awt.event.ActionEvent;
public class Functions {
Pawn pawn;
Rook rook;
Knight knight;
Bishop bishop;
King king;
Queen queen;
ChessPiece chessPiece;
EmptyField emptyField;
public Functions(ActionEvent e) {
}
public void setPieceType(ActionEvent e, int x, int y) {
if (e.getSource() instanceof ChessPiece) {
chessPiece = (ChessPiece) e.getSource();
} else {
emptyField = (EmptyField) e.getSource();
}
}
public int getPieceCoordX() {
return chessPiece.getCoordX();
}
public int getPieceCoodY() {
return chessPiece.getCoordY();
}
public boolean checkType(ActionEvent e) {
if (e.getSource() instanceof ChessPiece) {
return true;
} else return false;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment