aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/los/numeros/GameEngine/Engine.java
blob: 2cc509af89cad1e591929f12eb5335b60d7728de (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
package los.numeros.GameEngine;

import java.util.function.BooleanSupplier;

public interface Engine {
  public static int
  StartEngine(BooleanSupplier running, Module modules[])
  {
    /* run module inits */
    for (Module module : modules) {
      module.init();
    }

    /* wait for the game to end */
    while (running.getAsBoolean());

    /* run module ends */
    for (Module module : modules) {
      module.end();
    }

    return 0;
  }
}