10
10
import eu .solven .kumite .contest .ContestView ;
11
11
import eu .solven .kumite .game .GameSearchParameters ;
12
12
import eu .solven .kumite .game .IGameMetadataConstants ;
13
+ import eu .solven .kumite .player .PlayerContestStatus ;
13
14
import eu .solven .kumite .player .PlayerRawMovesHolder ;
14
15
import lombok .AllArgsConstructor ;
15
16
import lombok .NonNull ;
@@ -54,11 +55,12 @@ public void playOptimizationGames(UUID playerId) {
54
55
// Process each contest
55
56
.flatMap (contestView -> {
56
57
UUID contestId = contestView .getContestId ();
58
+ PlayerContestStatus playerStatus = contestView .getPlayerStatus ();
57
59
58
- if (contestView . getPlayingPlayer () .isPlayerHasJoined ()) {
60
+ if (playerStatus .isPlayerHasJoined ()) {
59
61
log .info ("Received board for already joined contestId={}" , contestId );
60
62
return Mono .empty ();
61
- } else if (contestView .getPlayingPlayer ().isPlayerCanJoin ()) {
63
+ } else if (contestView .getPlayerStatus ().isPlayerCanJoin ()) {
62
64
log .info ("Received board for joinable contestId={}" , contestId );
63
65
return kumiteServer .joinContest (playerId , contestId )
64
66
// We load the board again once we are signed-up
@@ -77,7 +79,7 @@ public void playOptimizationGames(UUID playerId) {
77
79
}
78
80
79
81
Mono <PlayerRawMovesHolder > exampleMoves =
80
- kumiteServer .getExampleMoves (joinedContestView .getPlayingPlayer ().getPlayerId (), contestId );
82
+ kumiteServer .getExampleMoves (joinedContestView .getPlayerStatus ().getPlayerId (), contestId );
81
83
82
84
return exampleMoves .flatMap (moves -> {
83
85
Optional <Map <String , ?>> selectedMove = selectMove (joinedContestView .getBoard (), moves );
@@ -127,10 +129,10 @@ public void play1v1(UUID playerId) {
127
129
.flatMap (contestView -> {
128
130
UUID contestId = contestView .getContestId ();
129
131
130
- if (contestView .getPlayingPlayer ().isPlayerHasJoined ()) {
132
+ if (contestView .getPlayerStatus ().isPlayerHasJoined ()) {
131
133
log .info ("Received board for already joined contestId={}" , contestId );
132
134
return Mono .empty ();
133
- } else if (contestView .getPlayingPlayer ().isPlayerCanJoin ()) {
135
+ } else if (contestView .getPlayerStatus ().isPlayerCanJoin ()) {
134
136
log .info ("Received board for joinable contestId={}" , contestId );
135
137
return kumiteServer .joinContest (playerId , contestId )
136
138
.flatMap (playingPlayer -> kumiteServer .loadBoard (contestId , playerId ));
@@ -150,7 +152,7 @@ public void play1v1(UUID playerId) {
150
152
}
151
153
152
154
Mono <PlayerRawMovesHolder > exampleMoves =
153
- kumiteServer .getExampleMoves (joinedContestView .getPlayingPlayer ().getPlayerId (), contestId );
155
+ kumiteServer .getExampleMoves (joinedContestView .getPlayerStatus ().getPlayerId (), contestId );
154
156
Mono <ContestView > monoContestViewPostMove = exampleMoves .flatMap (moves -> {
155
157
Optional <Map <String , ?>> optSelectedMove = selectMove (joinedContestView .getBoard (), moves );
156
158
0 commit comments