Skip to content

Annotations Metaprogramming

Almas Baimagambetov edited this page May 8, 2017 · 5 revisions

@AddCollisionHandler

Classes annotated with @AddCollisionHandler are automatically registered as collision handlers.

@AddCollisionHandler
class PlayerPowerupHandler extends CollisionHandler {
    ...
}

@SetEntityFactory

The class annotated with @SetEntityFactory is set as the main entity factory.

@SetEntityFactory
class MyEntityFactory implements EntityFactory {

}

'@OnUserAction'

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() {
    ...
}

'@Handles'

'@Spawns'

'@SpawnSymbol'

Clone this wiki locally