wip: create proper board analyzer for ai

This commit is contained in:
2021-06-05 20:52:15 +02:00
parent b183f623d6
commit 220136af55
5 changed files with 93 additions and 12 deletions

View File

@ -57,4 +57,29 @@ class Piece {
this.inventory = new HashSet<>(Arrays.asList(inventory));
this.stone = null;
}
private Piece(PieceType type, EntityID id, int hp, int maxHP, int mp, int maxMP, int ap, int maxAP, StoneType[] inventory, StoneType stone) {
this.type = type;
this.id = id;
this.hp = new Stat(StatType.HP, hp, maxHP);
this.mp = new Stat(StatType.MP, mp, maxMP);
this.ap = new Stat(StatType.AP, ap, maxAP);
this.inventory = new HashSet<>(Arrays.asList(inventory));
this.stone = stone;
}
public Piece clone() {
return new Piece(
this.type,
this.id,
this.hp.getValue(),
this.hp.getMax(),
this.mp.getValue(),
this.mp.getMax(),
this.ap.getValue(),
this.ap.getMax(),
this.inventory.toArray(new StoneType[0]),
this.stone
);
}
}