fix compiler errors
This commit is contained in:
parent
73add1442b
commit
b2a26c1f81
|
@ -2,4 +2,10 @@ import java.net.Socket;
|
||||||
|
|
||||||
public abstract class OnlinePlayer extends Player{
|
public abstract class OnlinePlayer extends Player{
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
|
|
||||||
|
public OnlinePlayer(int size, Socket socket) {
|
||||||
|
super(size);
|
||||||
|
this.socket = socket;
|
||||||
|
//TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.awt.Point;
|
||||||
|
|
||||||
public class SpecificAiPlayerMedium extends AiPlayer{
|
public class SpecificAiPlayerMedium extends AiPlayer{
|
||||||
|
|
||||||
|
@ -13,7 +16,7 @@ public class SpecificAiPlayerMedium extends AiPlayer{
|
||||||
// Shoot at the enemy and receive the hit response
|
// Shoot at the enemy and receive the hit response
|
||||||
enemy.receiveShoot(nextShot);
|
enemy.receiveShoot(nextShot);
|
||||||
|
|
||||||
HitResponse hitResponse = enemy.board.getHitResponsOnPoint(nextShot)
|
HitResponse hitResponse = enemy.board.getHitResponsOnPoint(nextShot);
|
||||||
// If it's a hit or sunk, add adjacent cells to the hitsQueue
|
// If it's a hit or sunk, add adjacent cells to the hitsQueue
|
||||||
if (hitResponse.getHitResponse() == HitResponseType.HIT) {
|
if (hitResponse.getHitResponse() == HitResponseType.HIT) {
|
||||||
addAdjacentPoints(nextShot);
|
addAdjacentPoints(nextShot);
|
||||||
|
@ -58,6 +61,11 @@ public class SpecificAiPlayerMedium extends AiPlayer{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean alreadyShot(Point p) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'alreadyShot'");
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isValidPoint(Point point) {
|
private boolean isValidPoint(Point point) {
|
||||||
return point.x >= 0 && point.x < board.getSize() &&
|
return point.x >= 0 && point.x < board.getSize() &&
|
||||||
point.y >= 0 && point.y < board.getSize();
|
point.y >= 0 && point.y < board.getSize();
|
||||||
|
|
Loading…
Reference in New Issue