lucasjoshua #14
|
@ -2,7 +2,9 @@ import java.util.Random;
|
||||||
|
|
||||||
public abstract class AiPlayer extends LocalPlayer {
|
public abstract class AiPlayer extends LocalPlayer {
|
||||||
|
|
||||||
public AiPlayer() {}
|
public AiPlayer() {
|
||||||
|
this.setName("AI Player");
|
||||||
|
}
|
||||||
public Point RandomPoint() {
|
public Point RandomPoint() {
|
||||||
Random random = new Random(); // Pseudo Random für zufallszahlen
|
Random random = new Random(); // Pseudo Random für zufallszahlen
|
||||||
int posx = random.nextInt(super.board.getSize()); // Generiert 0 - 13
|
int posx = random.nextInt(super.board.getSize()); // Generiert 0 - 13
|
||||||
|
|
|
@ -166,6 +166,8 @@ public class GameController {
|
||||||
localPlayer.setEnemy(aiPlayer);
|
localPlayer.setEnemy(aiPlayer);
|
||||||
aiPlayer.setEnemy(localPlayer);
|
aiPlayer.setEnemy(localPlayer);
|
||||||
|
|
||||||
|
localPlayer.setName(localPlayerName);
|
||||||
|
|
||||||
startGameWithInstancedPlayers(localPlayer, aiPlayer, size);
|
startGameWithInstancedPlayers(localPlayer, aiPlayer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public abstract class Player {
|
public abstract class Player {
|
||||||
protected boolean myTurn;
|
protected boolean myTurn;
|
||||||
protected boolean isServer;
|
protected boolean isServer;
|
||||||
|
@ -14,6 +12,7 @@ public abstract class Player {
|
||||||
protected boolean haseReceivedCoin;
|
protected boolean haseReceivedCoin;
|
||||||
|
|
||||||
public Player() {
|
public Player() {
|
||||||
|
this.setName("Player");
|
||||||
this.haseReceivedCoin = false;
|
this.haseReceivedCoin = false;
|
||||||
this.sendCoin = false;
|
this.sendCoin = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@ public class SpecificAiPlayerMedium extends AiPlayer{
|
||||||
|
|
||||||
private List<Point> hitsQueue = new ArrayList<>();
|
private List<Point> hitsQueue = new ArrayList<>();
|
||||||
|
|
||||||
|
public SpecificAiPlayerMedium() {
|
||||||
|
this.setName("AI Player Medium");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void AiShoot() {
|
public void AiShoot() {
|
||||||
Point nextShot = ComputeNextShot();
|
Point nextShot = ComputeNextShot();
|
||||||
|
|
Loading…
Reference in New Issue