DEADSOFTWARE

8c4fefbffc683801228073cb9bba571e4c9de8c9
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / GameProc.java
1 package ru.deadsoftware.cavedroid.game;
3 import com.badlogic.gdx.utils.Disposable;
4 import ru.deadsoftware.cavedroid.game.world.GameWorld;
6 import javax.inject.Inject;
8 @GameScope
9 public class GameProc implements Disposable {
11 public static final int MAX_CREATIVE_SCROLL = GameItems.getItemsSize() / 8;
13 private final GameWorld mGameWorld;
14 private final GamePhysics mGamePhysics;
15 private final GameInput mGameInput;
16 private final GameRenderer mGameRenderer;
18 @Inject
19 public GameProc(GameWorld gameWorld,
20 GamePhysics gamePhysics,
21 GameInput gameInput,
22 GameRenderer gameRenderer) {
23 mGameWorld = gameWorld;
24 mGamePhysics = gamePhysics;
25 mGameInput = gameInput;
26 mGameRenderer = gameRenderer;
28 mGameWorld.startFluidsThread();
29 }
31 public void update(float delta) {
32 mGamePhysics.update(delta);
33 mGameInput.update();
34 mGameWorld.update();
35 mGameRenderer.render(delta);
36 }
38 @Override
39 public void dispose() {
40 mGameWorld.dispose();
41 }
42 }