Modifications des classes liées aux actions

This commit is contained in:
valentinlucas 2021-10-20 15:43:54 +02:00
parent 1090d358c2
commit 134655b116
7 changed files with 77 additions and 3 deletions

View File

@ -1,4 +1,10 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game;
public abstract class AbstractAction implements Action { public abstract class AbstractAction implements Action {
private Game game;
public AbstractAction(Game game){
this.game = game;
}
} }

View File

@ -1,6 +1,10 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
public interface Action { import fr.lnl.game.server.games.grid.Grid;
import fr.lnl.game.server.games.player.Player;
public interface Action {
void doAction();
boolean isPossible();
public void doAction();
} }

View File

@ -1,8 +1,23 @@
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.player.AbstractPlayer;
public class DeployShield extends AbstractAction { public class DeployShield extends AbstractAction {
public DeployShield(Game game){
super(game);
}
@Override @Override
public void doAction(){ public void doAction(){
} }
@Override
public boolean isPossible() {
return true;
} }
}

View File

@ -1,4 +1,21 @@
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.player.AbstractPlayer;
public class DropBomb extends DropObject { public class DropBomb extends DropObject {
public DropBomb(Game game){
super(game);
}
@Override
public void doAction() {
}
@Override
public boolean isPossible() {
return false;
}
} }

View File

@ -1,4 +1,18 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game;
public class DropMine extends DropObject { public class DropMine extends DropObject {
public DropMine(Game game){
super(game);
}
@Override
public void doAction() {
super.doAction();
}
@Override
public boolean isPossible() {
return false;
}
} }

View File

@ -1,6 +1,13 @@
package fr.lnl.game.server.games.action; package fr.lnl.game.server.games.action;
import fr.lnl.game.server.games.Game;
public abstract class DropObject extends AbstractAction { public abstract class DropObject extends AbstractAction {
public DropObject(Game game){
super(game);
}
@Override @Override
public void doAction() { public void doAction() {

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 Nothing extends AbstractAction { public class Nothing extends AbstractAction {
public Nothing(Game game){
super(game);
}
@Override @Override
public void doAction() { public void doAction() {
} }
@Override
public boolean isPossible() {
return true;
}
} }