Singleton marker type component - junkdog/artemis-odb GitHub Wiki
Singleton marker-type components
Sometimes it can be useful to assign tag-type components - components with no data other than belonging to an entity.
If the project is setup with the maven plugin or when using the CLI, the easiest way is using @PackedWeaver on a component with no fields, thereby ensuring there will only ever be one instance of the component.
@PackedWeaver
public class SingletonComponent extends Component {}
The above code is equivalent to:
public class SingletonComponent extends PackedComponent {
@Override
protected void forEntity(Entity e) {}
@Override
protected void ensureCapacity(int id) {}
@Override
protected void reset() {}
}