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
fcc3e32a
Commit
fcc3e32a
authored
Dec 16, 2017
by
Quentin DRUAULT-AUBIN
Committed by
Paul Jeannot
Dec 17, 2017
Browse files
[Table] Pass my player in parameter of placeMine
parent
f22e5e0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/ihmtable/controller/InGameGUIController.java
View file @
fcc3e32a
...
...
@@ -233,6 +233,11 @@ public class InGameGUIController {
*/
private
Player
currentPlayer
;
/**
* Me.
*/
private
Player
myPlayer
;
/**
* True if playing review game
...
...
@@ -389,6 +394,8 @@ public class InGameGUIController {
updateStatsPannel
();
// Get the current player.
currentPlayer
=
facade
.
getFacadeData
().
getGame
().
getCurrentPlayer
();
// Get my player.
myPlayer
=
facade
.
getFacadeData
().
getGame
().
getPlayer
(
facade
.
getFacadeData
().
getMyPublicUserProfile
().
getId
());
}
/**
...
...
@@ -575,7 +582,7 @@ public class InGameGUIController {
// in a Mine returned with attack)
Pair
<
Integer
,
Ship
>
fireResult
=
facade
.
getFacadeData
().
attack
(
cellToAttack
,
true
);
placeMine
(
cellToAttack
,
current
Player
);
placeMine
(
cellToAttack
,
my
Player
);
// Update stats pannel
currentPlayerStats
.
turnPlayed
((
fireResult
.
getKey
()
==
1
),
(
fireResult
.
getValue
()
!=
null
));
...
...
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