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
4d1f9a13
Commit
4d1f9a13
authored
Jan 03, 2018
by
Peining
Browse files
Merge branch 'develop' of
https://gitlab.utc.fr/qdruault/lo23-project
into develop
modify functions about statistics
parents
95681eb2
969f928b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/data/facade/DataFacade.java
View file @
4d1f9a13
...
...
@@ -284,7 +284,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
@Override
public
void
leaveGame
()
{
String
role
=
this
.
gameMediator
.
getOwnerStatus
();
if
(!
role
.
equals
(
"spectator"
)
&&
this
.
gameMediator
.
getCurrentGame
()!=
null
)
{
if
(!
role
.
equals
(
"spectator"
)
&&
this
.
gameMediator
.
getCurrentGame
()
!=
null
)
{
Logger
.
getLogger
(
DataFacade
.
class
.
getName
()).
log
(
Level
.
INFO
,
null
,
"data | leave game"
);
this
.
comfacade
.
leaveGame
(
this
.
gameMediator
.
getCurrentGame
().
getRecipients
(
this
.
getMyPublicUserProfile
().
getPlayerName
()));
...
...
@@ -308,7 +308,6 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
public
void
opponentHasLeftGame
()
{
Logger
.
getLogger
(
DataFacade
.
class
.
getName
()).
info
(
"data | opponent has left"
);
if
(!
this
.
gameMediator
.
isFinishedGame
())
{
try
{
this
.
gameMediator
.
defWin
();
...
...
@@ -319,10 +318,9 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
this
.
ihmTablefacade
.
opponentHasLeftGame
();
}
}
@Override
public
void
removeGame
(
String
id
)
{
public
void
removeGame
(
String
id
)
{
this
.
gameMediator
.
removeGame
(
id
);
}
...
...
@@ -426,14 +424,16 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
public
PublicUser
getMyPublicUserProfile
()
{
PublicUser
usr
=
this
.
userMediator
.
getMyPublicUserProfile
();
try
{
usr
.
setNumberDefeatsClassic
(
this
.
getNumberDefeatsClassic
());
if
(
usr
!=
null
)
{
try
{
usr
.
setNumberDefeatsClassic
(
this
.
getNumberDefeatsClassic
());
usr
.
setNumberVictoriesClassic
(
this
.
getNumberVictoriesClassic
());
usr
.
setNumberAbandonsClassic
(
this
.
getNumberAbandonsClassic
());
}
catch
(
DataException
ex
)
{
Logger
.
getLogger
(
DataFacade
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
catch
(
DataException
ex
)
{
Logger
.
getLogger
(
DataFacade
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
return
usr
;
...
...
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