aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/los/numeros/gameEngine/Engine.java
blob: ba09cf027a293eba25ba4993dc9740173e3976c5 (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
33
34
35
36
37
38
39
40
41
package los.numeros.gameEngine;

import java.util.function.BooleanSupplier;

public interface Engine {
  public static int StartEngine(BooleanSupplier running, Module modules[])
  {
    /* start game init tasks */
    GameStart();

    /* run module inits */
    for (Module module : modules) {
      module.init();
    }

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

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

    return 0;
  }

  public static int
  GameStart()
  {
    return 0;
  }

  public static int
  GameEnd()
  {
    return 0;
  }
}