-
-
Notifications
You must be signed in to change notification settings - Fork 563
Annotations Metaprogramming
Almas Baimagambetov edited this page Aug 4, 2017
·
5 revisions
For the annotation processor to work properly the package name must be present and it must not contain uppercase letters.
Classes annotated with @AddCollisionHandler
are automatically registered as collision handlers.
@AddCollisionHandler
class PlayerPowerupHandler extends CollisionHandler {
...
}
The class annotated with @SetEntityFactory
is set as the main entity factory.
@SetEntityFactory
class MyEntityFactory implements EntityFactory {
}
Indicates that a method is called when user triggers an action.
The method signature must be public void anyName()
.
@OnUserAction(name = "Move Left")
public void moveLeft() {
...
}