Commit 5f55c96a authored by Hugo DACLON's avatar Hugo DACLON
Browse files

appli qui fonctionne (j'espere)

parent 3b184a87
......@@ -249,18 +249,15 @@ public class CreationFlotte extends JPanel {// JPanel {
selectedCell = null;
throw new CoordsBadShipException();
}
for (IShip flotteShip : appli.getFlotte().getShips()) {
for (ICoord c : newShip.getCoords()) {
if (flotteShip.getCoords().contains(c)) {
selectedCell = null;
switch (appli.getFlotte().add(newShip)){
case 0 :
map.ajouterBateau(newShip);
break;
default :
throw new CoordsBadShipException();
}
}
}
selectedCell = null;
appli.getFlotte().add(newShip);
map.ajouterBateau(newShip);
}
private boolean isVertical(Coord cell) {
return (selectedCell.getX() == cell.getX());
......@@ -370,4 +367,9 @@ public class CreationFlotte extends JPanel {// JPanel {
public void fixeListenerRefresh(ActionListener l) {
refresh.addActionListener(l);
}
public void actualiserMap() {
map.resetGrille();
map.ajouterFlotte(appli.getFlotte());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment