Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin DRUAULT-AUBIN
lo23-project
Commits
95c01d58
Commit
95c01d58
authored
Dec 18, 2017
by
dkonam
Browse files
Merge branch 'Data/setEnnemyShip' into Data/develop
parents
79a2df6f
c8e11bf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/data/facade/DataFacade.java
View file @
95c01d58
...
...
@@ -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
);
}
/**
...
...
Battleship/src/main/java/com/utclo23/data/module/GameMediator.java
View file @
95c01d58
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment