public class SpongeEventFactoryUtils extends Object
SpongeEventFactory
Since SpongeEventFactory
is automatically generated, the formatting can get messed up.
This class ensures that the core logic stays readable.
Modifier and Type | Field and Description |
---|---|
static List<? extends EventFactoryPlugin> |
plugins |
Constructor and Description |
---|
SpongeEventFactoryUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createEventImpl(Class<T> type,
Map<String,Object> values)
Creates an event class from an interface and a map of property names to values.
|
static <T extends GameStateEvent> |
createState(Class<T> type,
Game game)
Creates a new
GameStateEvent of the given type. |
public static List<? extends EventFactoryPlugin> plugins
public static <T> T createEventImpl(Class<T> type, Map<String,Object> values)
T
- The type of event to be createdtype
- The event interface to generate a class forvalues
- The map of property names to valuespublic static <T extends GameStateEvent> T createState(Class<T> type, Game game)
GameStateEvent
of the given type.T
- The type of the state eventtype
- The type of the state eventgame
- The game instance for this GameEvent