Commit 95c01d58 authored by dkonam's avatar dkonam
Browse files

Merge branch 'Data/setEnnemyShip' into Data/develop

parents 79a2df6f c8e11bf7
......@@ -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);
}
/**
......
......@@ -588,4 +588,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