Skip to content

[FEATURE] Provide annotation-compatible constructors in IntervalSystem #652

@cpbeto

Description

@cpbeto

I propose both IntervalSystem and IntervalIteratingSystem provide a constructor that takes only the parameter float interval.

For example:

public IntervalSystem(float interval) {
	super(null);
	this.interval = interval;
}

public IntervalIteratingSystem(float interval) {
	super(interval);
}

I think this would make it more idiomatic to write extended systems, which use annotations for entity subscriptions. For example:

@All({Component1.class, Component2.class})
@Exclude(Component3.class)
public class MyIntervalSystem extends IntervalIteratingSystem {

    public MyIntervalSystem(float interval) {
        super(interval);
        // etc.
    }

    @Override
    protected void process(int entityId) {
        // etc.
    }
}

... instead of calling super(null, interval).

Cheers 👍

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions