Commit c8e11bf7 authored by Lucille Fargeau's avatar Lucille Fargeau
Browse files

setEnnemyShips

parent f208f789
......@@ -246,7 +246,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
*/
@Override
public void setEnnemyShips(List<Ship> ships) {
//this.gameMediator.setEnnemyShips(ships);
this.gameMediator.setEnnemyShips(ships);
}
/**
......
......@@ -507,4 +507,20 @@ public class GameMediator {
return status;
}
}
public void setEnnemyShips(List<Ship> ships) {
// Check game is instanciated
if (this.currentGame != null){
if(!ships.isEmpty()){
// retrieve the id of the player that put the ships
String player_id = ships.get(0).getOwner().getLightPublicUser().getId();
// Retrieve the player that put the ships
Player p = this.currentGame.getPlayer(player_id);
// Set the ships
p.setShips(ships);
}
}
}
}
\ No newline at end of file
Supports Markdown
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