aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/java/coffee/liz/ecs/model/System.java
blob: 8138a0b2eee10206f27e34946d9644ec7802f0e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package coffee.liz.ecs.model;

import java.time.Duration;
import java.util.Collection;

/**
 * Updates the {@link World} state.
 *
 * @param <T>
 *            is the state of the stuff outside the {@link World}.
 */
public interface System<T> {
    /**
     * {@link System} clazzes that must run before this system.
     *
     * @return {@link Collection} of dependencies.
     */
    Collection<Class<? extends System<T>>> getDependencies();

    /**
     * @param world
     *            Is the {@link World}.
     * @param state
     *            Is the {@link T} state outside the {@param world}.
     * @param dt
     *            Is the timestep.
     */
    void update(final World<T> world, final T state, final Duration dt);

    default void dispose() {
    }
}