Interface ClientAcknowledgementState
- All Known Implementing Classes:
NoClientAcknowledgement,PendingClientAcknowledgement
public interface ClientAcknowledgementState
Runtime state for a client acknowledgement request.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(UUID playerId, UUID acknowledgementId) Handles an acknowledgement received from a client.voidcomplete()Marks acknowledgement as complete.config()Returns the acknowledgement configuration that created this state.id()Returns the acknowledgement id clients must echo back.booleanReturns whether all required clients have acknowledged.booleanReturns whether this state is waiting on clients.booleanReturns whether this acknowledgement has timed out.voidtick()Advances timeout tracking by one tick.Returns the clients that have not acknowledged yet.
-
Method Details
-
isPending
boolean isPending()Returns whether this state is waiting on clients.- Returns:
truewhile acknowledgement is pending
-
id
UUID id()Returns the acknowledgement id clients must echo back.- Returns:
- the acknowledgement id
-
config
BattleAnimationClientAcknowledgement config()Returns the acknowledgement configuration that created this state.- Returns:
- the acknowledgement configuration
-
waitingFor
Returns the clients that have not acknowledged yet.- Returns:
- the waiting player ids
-
tick
void tick()Advances timeout tracking by one tick. -
acknowledge
Handles an acknowledgement received from a client.- Parameters:
playerId- the acknowledging playeracknowledgementId- the acknowledgement id sent by the client
-
isComplete
boolean isComplete()Returns whether all required clients have acknowledged.- Returns:
truewhen acknowledgement is complete
-
isTimedOut
boolean isTimedOut()Returns whether this acknowledgement has timed out.- Returns:
truewhen the configured timeout has elapsed
-
complete
void complete()Marks acknowledgement as complete.
-