All of it.

This commit is contained in:
Jacob Signorovitch
2025-04-24 15:00:45 -04:00
parent 187b0bf570
commit 64a3f07d4a
5 changed files with 34 additions and 3 deletions

View File

@@ -6,4 +6,17 @@ abstract class Actor {
Boolean inCheck; // Whether the Actor is currently in check.
Boolean canCastle; // Whether the Actor can castle.
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;
}
}

6
chess/src/chess/Bot.java Normal file
View File

@@ -0,0 +1,6 @@
package chess;
// A chess bot.
class Bot extends Actor {
Bot(Util.Col col) { super(col); }
}

View File

@@ -1,6 +1,12 @@
package chess;
class Game {
import javalib.impworld.*;
class Game extends World {
Actor white;
Actor black;
public WorldScene makeScene() { return new WorldScene(0, 0); }
void run() { this.bigBang(0, 0, 0.01); }
}

View File

@@ -1,3 +1,7 @@
package chess;
class Main {}
import tester.Tester;
class Examples {
void testItAll(Tester t) { new Game().run(); }
}

View File

@@ -1,4 +1,6 @@
package chess;
// A human-controlled Actor.
class Player extends Actor {}
class Player extends Actor {
Player(Util.Col col) { super(col); }
}