summaryrefslogtreecommitdiff
path: root/core/src/org/snoopdesigns/endless/context/Context.java
blob: 4081c87599338d1f24c857a1fd8b00977a9ec2d5 (plain)
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
package org.snoopdesigns.endless.context;

import org.snoopdesigns.endless.physics.WorldContext;
import org.snoopdesigns.endless.physics.camera.CameraContext;
import org.snoopdesigns.endless.world.player.PlayerShip;

public final class Context implements OnInit {
    private static Context INSTANCE;

    private CameraContext cameraContext;
    private WorldContext worldContext;
    private PlayerShip playerShip;

    @Override
    public void create() {
        INSTANCE = new Context();
        INSTANCE.cameraContext = new CameraContext();
        INSTANCE.worldContext = new WorldContext();
        INSTANCE.playerShip = new PlayerShip();
    }

    public static Context getInstance() {
        return INSTANCE;
    }

    public CameraContext getCameraContext() {
        return cameraContext;
    }

    public WorldContext getWorldContext() {
        return worldContext;
    }

    public PlayerShip getPlayerShip() {
        return playerShip;
    }
}