All of it.
This commit is contained in:
@@ -6,4 +6,17 @@ abstract class Actor {
|
|||||||
Boolean inCheck; // Whether the Actor is currently in check.
|
Boolean inCheck; // Whether the Actor is currently in check.
|
||||||
Boolean canCastle; // Whether the Actor can castle.
|
Boolean canCastle; // Whether the Actor can castle.
|
||||||
Boolean won; // Whether the Actor has won.
|
Boolean won; // Whether the Actor has won.
|
||||||
|
|
||||||
|
Actor(Util.Col col, Boolean inCheck, Boolean canCastle, Boolean won) {
|
||||||
|
this.col = col;
|
||||||
|
this.inCheck = inCheck;
|
||||||
|
this.canCastle = canCastle;
|
||||||
|
this.won = won;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convenience constructor for start of game.
|
||||||
|
Actor(Util.Col col) {
|
||||||
|
this.col = col;
|
||||||
|
this.inCheck = this.canCastle = this.won = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package chess;
|
||||||
|
|
||||||
|
// A chess bot.
|
||||||
|
class Bot extends Actor {
|
||||||
|
Bot(Util.Col col) { super(col); }
|
||||||
|
}
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
package chess;
|
package chess;
|
||||||
|
|
||||||
class Game {
|
import javalib.impworld.*;
|
||||||
|
|
||||||
|
class Game extends World {
|
||||||
Actor white;
|
Actor white;
|
||||||
Actor black;
|
Actor black;
|
||||||
|
|
||||||
|
public WorldScene makeScene() { return new WorldScene(0, 0); }
|
||||||
|
|
||||||
|
void run() { this.bigBang(0, 0, 0.01); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
package chess;
|
package chess;
|
||||||
|
|
||||||
class Main {}
|
import tester.Tester;
|
||||||
|
|
||||||
|
class Examples {
|
||||||
|
void testItAll(Tester t) { new Game().run(); }
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
package chess;
|
package chess;
|
||||||
|
|
||||||
// A human-controlled Actor.
|
// A human-controlled Actor.
|
||||||
class Player extends Actor {}
|
class Player extends Actor {
|
||||||
|
Player(Util.Col col) { super(col); }
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user