Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
обновил бота Васи
Browse files Browse the repository at this point in the history
  • Loading branch information
oQaris committed Aug 18, 2021
1 parent 09866c2 commit 0deb1e3
Show file tree
Hide file tree
Showing 23 changed files with 1,001 additions and 242 deletions.
6 changes: 3 additions & 3 deletions lobot/src/main/java/io/deeplay/qchess/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import io.deeplay.qchess.game.player.Player;
import io.deeplay.qchess.game.player.RandomBot;
import io.deeplay.qchess.lobot.LoBot;
import io.deeplay.qchess.lobot.strategy.FiguresCostSumEvaluateStrategy;
import io.deeplay.qchess.lobot.Strategy;

public class Main {

public static void main(final String[] args) throws ChessError {
final GameSettings roomSettings = new GameSettings(Board.BoardFilling.STANDARD);

final Player firstPlayer =
new LoBot(roomSettings, Color.WHITE, new FiguresCostSumEvaluateStrategy());
final Player firstPlayer = new LoBot(roomSettings, Color.WHITE, new Strategy());
final Player secondPlayer = new RandomBot(roomSettings, Color.BLACK);

final Selfplay game = new Selfplay(roomSettings, firstPlayer, secondPlayer);
Expand Down
55 changes: 55 additions & 0 deletions lobot/src/main/java/io/deeplay/qchess/lobot/ClusterPoint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package io.deeplay.qchess.lobot;

import java.util.Objects;

public class ClusterPoint {

private int value;
private int mark;

public ClusterPoint(final int value, final int mark) {
setValue(value);
setMark(mark);
}

public int getValue() {
return value;
}

public void setValue(final int value) {
this.value = value;
}

public int getMark() {
return mark;
}

public void setMark(final int mark) {
this.mark = mark;
if (mark < -1) {
this.mark = 0;
}
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ClusterPoint that = (ClusterPoint) o;
return value == that.value && mark == that.mark;
}

@Override
public int hashCode() {
return Objects.hash(value, mark);
}

@Override
public String toString() {
return "{" + "value=" + value + ", mark=" + mark + '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Map;

public class FigureService {

private static final Map<FigureType, Character> charFigureMap = new HashMap<>();
private static final Map<Character, Integer> intCharMap = new HashMap<>();
private static final Map<FigureType, Integer> figureValMap = new HashMap<>();
Expand Down
Loading

0 comments on commit 0deb1e3

Please sign in to comment.