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