Skip to content
Snippets Groups Projects
Commit bd9f4f4f authored by ACIKBAS TUNA's avatar ACIKBAS TUNA
Browse files

Creation of the remaining pieces

- Bishop
- Rook
- Knight
- Queen
parent 5d19e94e
Branches
1 merge request!4Creation of the remaining pieces
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/MavenChess.iml" filepath="$PROJECT_DIR$/.idea/MavenChess.iml" />
</modules>
</component>
</project>
\ No newline at end of file
package model;
import java.util.ArrayList;
public class Bishop extends Pawn{
public Bishop(Position p, int color) {
super(p, color);
}
public ArrayList<Position> getAvailableMoves(Board b) {
// creates a dynamic list of available moves
ArrayList<Position> moves = new ArrayList<Position>();
Position arrival;
if(color == Piece.WHITE) { // black and white have an opposite direction behavior
// King white move
}
else {
// King black move
}
return moves;
}
}
package model;
import java.util.ArrayList;
public class Knight extends Pawn{
public Knight(Position p, int color) {
super(p, color);
}
public ArrayList<Position> getAvailableMoves(Board b) {
// creates a dynamic list of available moves
ArrayList<Position> moves = new ArrayList<Position>();
Position arrival;
if(color == Piece.WHITE) { // black and white have an opposite direction behavior
// King white move
}
else {
// King black move
}
return moves;
}
}
......@@ -2,6 +2,8 @@ package model;
import java.util.ArrayList;
public abstract class Piece {
protected Position p;
protected int color;
......
package model;
import java.util.ArrayList;
public class Queen extends Piece{
protected Queen(Position p, int color) {
super(p, color);
}
public ArrayList<Position> getAvailableMoves(Board b) {
// creates a dynamic list of available moves
ArrayList<Position> moves = new ArrayList<Position>();
Position arrival;
if(color == Piece.WHITE) { // black and white have an opposite direction behavior
// King white move
}
else {
// King black move
}
return moves;
}
}
package model;
import java.util.ArrayList;
public class Rook extends Pawn{
public Rook(Position p, int color) {
super(p, color);
}
public ArrayList<Position> getAvailableMoves(Board b) {
// creates a dynamic list of available moves
ArrayList<Position> moves = new ArrayList<Position>();
Position arrival;
if(color == Piece.WHITE) { // black and white have an opposite direction behavior
// King white move
}
else {
// King black move
}
return moves;
}
}
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