Compare commits
1 commit
a1a087338b
...
160dbff816
Author | SHA1 | Date | |
---|---|---|---|
160dbff816 |
1 changed files with 12 additions and 17 deletions
|
@ -12,18 +12,15 @@ public class MatchConfirmationService {
|
|||
|
||||
private final Map<Player, UnconfirmedMatch> unconfirmedMatch = new HashMap<>();
|
||||
|
||||
public UnconfirmedMatch createMatch
|
||||
(Player player1,
|
||||
public UnconfirmedMatch createMatch(Player player1,
|
||||
Player player2,
|
||||
ConfirmationCallbacks player1Callbacks,
|
||||
ConfirmationCallbacks player2callbacks
|
||||
) {
|
||||
ConfirmationCallbacks player2callbacks) {
|
||||
UnconfirmedMatch match = new UnconfirmedMatch(
|
||||
player1,
|
||||
player2,
|
||||
player1Callbacks,
|
||||
player2callbacks
|
||||
);
|
||||
player2callbacks);
|
||||
unconfirmedMatch.put(player1, match);
|
||||
unconfirmedMatch.put(player2, match);
|
||||
return match;
|
||||
|
@ -82,18 +79,16 @@ public class MatchConfirmationService {
|
|||
player1Callbacks.getFoundCallback(),
|
||||
player1Callbacks.getQueuedCallback(),
|
||||
player1Callbacks.getAbortCallback(),
|
||||
player1Callbacks.getEstablishedCallback()
|
||||
);
|
||||
player1Callbacks.getEstablishedCallback());
|
||||
}
|
||||
if (match.getPlayer1State() == PlayerMatchConfirmState.CONFIRMED){
|
||||
if (match.getPlayer2State() == PlayerMatchConfirmState.CONFIRMED) {
|
||||
player2Callbacks.getRequeueCallback().call(
|
||||
match.getPlayer2(),
|
||||
match.getMatchId(),
|
||||
player2Callbacks.getFoundCallback(),
|
||||
player2Callbacks.getQueuedCallback(),
|
||||
player2Callbacks.getAbortCallback(),
|
||||
player2Callbacks.getEstablishedCallback()
|
||||
);
|
||||
player2Callbacks.getEstablishedCallback());
|
||||
}
|
||||
}
|
||||
case CONFIRMED -> {
|
||||
|
|
Loading…
Add table
Reference in a new issue