Fix omissions + Optimize import

This commit is contained in:
Katchan 2021-10-21 15:54:53 +02:00
parent 134655b116
commit 8f19cf400c
11 changed files with 25 additions and 10 deletions

View File

@ -1,7 +1,5 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.grid.Grid;
import fr.lnl.game.server.games.player.Player;
public interface Action { public interface Action {
void doAction(); void doAction();

View File

@ -1,7 +1,6 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game; import fr.lnl.game.server.games.Game;
import fr.lnl.game.server.games.player.AbstractPlayer;
public class DeployShield extends AbstractAction { public class DeployShield extends AbstractAction {
public DeployShield(Game game){ public DeployShield(Game game){

View File

@ -1,7 +1,6 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game; import fr.lnl.game.server.games.Game;
import fr.lnl.game.server.games.player.AbstractPlayer;
public class DropBomb extends DropObject { public class DropBomb extends DropObject {

View File

@ -1,8 +1,19 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game;
public class Move extends AbstractAction { public class Move extends AbstractAction {
public Move(Game game) {
super(game);
}
@Override @Override
public void doAction() { public void doAction() {
} }
@Override
public boolean isPossible() {
return false;
}
} }

View File

@ -1,8 +1,19 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game;
public class Shot extends AbstractAction { public class Shot extends AbstractAction {
public Shot(Game game) {
super(game);
}
@Override @Override
public void doAction() { public void doAction() {
} }
@Override
public boolean isPossible() {
return false;
}
} }

View File

@ -72,7 +72,7 @@ public class Grid {
System.out.print("\n"); System.out.print("\n");
for (int j = 0; j < y; j++) { for (int j = 0; j < y; j++) {
Pair<Player, Box> value = board.get(new Point(i, j)); Pair<Player, Box> value = board.get(new Point(i, j));
if(value.getA() instanceof Player){ if(value.getA() != null){
System.out.print(" \033[0;34mP\033[0m"); System.out.print(" \033[0;34mP\033[0m");
} }
else if (value.getB() instanceof Wall) { else if (value.getB() instanceof Wall) {

View File

@ -2,7 +2,6 @@ package fr.lnl.game.server.games.player;
import fr.lnl.game.server.games.action.Action; import fr.lnl.game.server.games.action.Action;
import fr.lnl.game.server.games.weapon.Weapon; import fr.lnl.game.server.games.weapon.Weapon;
import fr.lnl.game.server.utils.Point;
public abstract class AbstractPlayer implements Player { public abstract class AbstractPlayer implements Player {

View File

@ -1,7 +1,6 @@
package fr.lnl.game.server.games.player; package fr.lnl.game.server.games.player;
import fr.lnl.game.server.games.weapon.Weapon; import fr.lnl.game.server.games.weapon.Weapon;
import fr.lnl.game.server.utils.Point;
public interface ClassPlayer { public interface ClassPlayer {

View File

@ -1,7 +1,5 @@
package fr.lnl.game.server.games.player; package fr.lnl.game.server.games.player;
import fr.lnl.game.server.utils.Point;
public class ComputerPlayer extends AbstractPlayer{ public class ComputerPlayer extends AbstractPlayer{
public ComputerPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) { public ComputerPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {

View File

@ -3,6 +3,8 @@ package fr.lnl.game.server.games.player;
import fr.lnl.game.server.games.weapon.Firearm; import fr.lnl.game.server.games.weapon.Firearm;
import fr.lnl.game.server.games.weapon.Weapon; import fr.lnl.game.server.games.weapon.Weapon;
@SuppressWarnings("all")
public class DefaultClassPlayer implements ClassPlayer{ public class DefaultClassPlayer implements ClassPlayer{
private final int ENERGY = 800; private final int ENERGY = 800;

View File

@ -1,6 +1,5 @@
package fr.lnl.game.server.games.player; package fr.lnl.game.server.games.player;
import fr.lnl.game.server.utils.Point;
public class HumanPlayer extends AbstractPlayer { public class HumanPlayer extends AbstractPlayer {