Interface GameplayHookHandler<R,V>

Type Parameters:
R - the request type
V - the substituted value type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GameplayHookHandler<R,V>
A scenario's answer to one gameplay decision point.

Handlers run on the server main thread, inside the game they were registered for, and are dropped automatically when the scenario or the game ends. A handler that throws is isolated: the exception is logged against the owning scenario and treated as HookOutcome.pass(), so one broken scenario can never break the decision for anybody else.

Since:
1.6.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull HookOutcome<V>
    handle(R request)
    Decides what happens at this decision point.
  • Method Details

    • handle

      @NotNull @NotNull HookOutcome<V> handle(@NotNull R request)
      Decides what happens at this decision point.
      Parameters:
      request - the request; mutable where the hook documents it as such
      Returns:
      what to do, never null