Skip to content

Commit

Permalink
Removes dependency to GameBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed Apr 14, 2024
1 parent 919b5f8 commit f472c73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.0.8</version>
</parent>
<artifactId>jchess-core</artifactId>
<version>0.0.7-SNAPSHOT</version>
<version>0.0.8-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/fathzer/jchess/GameBuilders.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.fathzer.jchess;

import com.fathzer.games.GameBuilder;
import java.util.function.Supplier;

import com.fathzer.jchess.chess960.Chess960Board;
import com.fathzer.jchess.chess960.StartPositionGenerator;
import com.fathzer.jchess.fen.FENUtils;

public class GameBuilders {
public static final GameBuilder<Board<Move>> STANDARD = () -> FENUtils.from(FENUtils.NEW_STANDARD_GAME);
public static final GameBuilder<Board<Move>> CHESS960 = () -> new Chess960Board(StartPositionGenerator.INSTANCE.get());
public static final Supplier<Board<Move>> STANDARD = () -> FENUtils.from(FENUtils.NEW_STANDARD_GAME);
public static final Supplier<Board<Move>> CHESS960 = () -> new Chess960Board(StartPositionGenerator.INSTANCE.get());

private GameBuilders() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void testInsufficientMaterial() {

@Test
void drawByRepetitionTest() {
Board<Move> board = GameBuilders.STANDARD.newGame();
Board<Move> board = GameBuilders.STANDARD.get();
final Move kwf = move(board,"b1", "c3");
final Move kwb = move(board,"c3", "b1");
final Move kbf = move(board, "b8", "c6");
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/fathzer/jchess/pgn/PGNWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class PGNWriterTest implements MoveBuilder {

@Test
void test() {
final Board<Move> board = GameBuilders.STANDARD.newGame();
final Board<Move> board = GameBuilders.STANDARD.get();
final GameHistory history = new GameHistory(board);
history.add(move(board, "e2", "e4"));
history.add(move(board, "e7", "e5"));
Expand Down Expand Up @@ -47,7 +47,7 @@ void test() {

@Test
void bug20231025() {
final Board<Move> board = GameBuilders.STANDARD.newGame();
final Board<Move> board = GameBuilders.STANDARD.get();
final GameHistory history = new GameHistory(board);
history.add(move(board, "c2", "c4"));
history.add(move(board, "g8", "f6"));
Expand Down

0 comments on commit f472c73

Please sign in to comment.