Skip to content

Commit

Permalink
Winboard creation looks well
Browse files Browse the repository at this point in the history
  • Loading branch information
lrozenblyum committed Aug 14, 2019
1 parent 648844d commit 0596fc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/leokom/chess/MainRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ private MainRunner() {
*
* <code>engineName</code> could be any of:
* <ul>
* <li>Winboard</li>
* <li>ui.winboard</li>
* <li>brain.simple</li>
* <li>brain.denormalized</li>
* <li>brain.normalized</li>
* </ul>
*
* Default players:
* <ul>
* <li>-Dwhite.engine=Winboard</li>
* <li>-Dwhite.engine=ui.winboard</li>
* <li>-Dblack.engine=brain.normalized</li>
* </ul>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ Optional<String> getFor( Side side ) {
public Player apply( Side side ) {
String engineName = engineProperty.getFor( side ).orElseGet( () -> {
logger.info( "Selecting a default engine for Side = " + side );
return side == Side.WHITE ? "Winboard" : "brain.normalized";
return side == Side.WHITE ? "ui.winboard" : "brain.normalized";
} );

return getPlayer( side, engineName );
}

private Player getPlayer(Side side, String engineName ) {
private Player getPlayer( Side side, String engineName ) {
logger.info("Selecting an engine for Side = " + side + " by engine name = " + engineName);
switch (engineName) {
case "brain.normalized":
Expand All @@ -94,7 +94,7 @@ private Player getPlayer(Side side, String engineName ) {
return new LegalPlayer( new DenormalizedBrain() );
case "brain.simple":
return new LegalPlayer( new SimpleBrain() );
case "Winboard":
case "ui.winboard":
return WinboardPlayer.create();
default:
throw new IllegalArgumentException( "The engine is not supported: " + engineName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void assertIsSimple(Player player) {

@Test
public void canSelectWinboardForBlack() {
System.setProperty( "black.engine", "Winboard" );
System.setProperty( "black.engine", "ui.winboard" );

final Player player = new CommandLinePlayers().apply( Side.BLACK );
assertTrue( player instanceof WinboardPlayer );
Expand Down

0 comments on commit 0596fc5

Please sign in to comment.