diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..fb50116 --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..cb0f832 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + CSE-4705-Checkers + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/model/Color.java b/src/model/Color.java new file mode 100644 index 0000000..4b2a351 --- /dev/null +++ b/src/model/Color.java @@ -0,0 +1,6 @@ +package model; + +public enum Color { + RED, + BLACK +} diff --git a/src/model/Piece.java b/src/model/Piece.java new file mode 100644 index 0000000..b3765a1 --- /dev/null +++ b/src/model/Piece.java @@ -0,0 +1,36 @@ +package model; + +public class Piece { + public final Color color; + private int x; + private int y; + private Type type; + + public Piece(Color color, int x, int y) { + this.color = color; + this.x = x; + this.y = y; + this.type = Type.NORMAL; + } + + public void updateCoordinates(int x, int y) { + this.x = x; + this.y = y; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public void promote() { + this.type = Type.KING; + } + + public Type getType() { + return this.type; + } +} diff --git a/src/model/Type.java b/src/model/Type.java new file mode 100644 index 0000000..3156fdc --- /dev/null +++ b/src/model/Type.java @@ -0,0 +1,6 @@ +package model; + +public enum Type { + NORMAL, + KING +}