Class ExtensionContext.InputKey<T>
java.lang.Object
org.openpatch.scratch.extension.ExtensionContext.InputKey<T>
- Type Parameters:
T- the state kept in the slot
- Enclosing interface:
ExtensionContext
A slot in the input snapshot: polled on the window thread, copied to the game thread with
each batch of ticks, so no locking is needed.
-
Method Summary
-
Method Details
-
of
public static <T> ExtensionContext.InputKey<T> of(String name, Supplier<T> factory, BiConsumer<T, T> copy) - Type Parameters:
T- the state- Parameters:
name- for messagesfactory- makes an empty state (twice: one per thread)copy- copies the window thread's state into the game thread's: (from, into)- Returns:
- the key
-
create
For the core: makes a state for this key. -
copy
-
toString
-