summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/Game.java
blob: b3d51904ac5a15986ee50bb10678a15e609bff62 (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
42
43
44
45
46
47
48
49
50
51
52
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fourisland.fourpuzzle;

import com.fourisland.fourpuzzle.gamestate.mapview.event.HeroEvent;
import com.fourisland.fourpuzzle.gamestate.GameState;

/**
 *
 * @author hatkirby
 */
public class Game {
    
    public static final int WIDTH = 320;
    public static final int HEIGHT = 240;
    public static final int FPS = (1000 / 20); // 20 fps

    private static SaveFile saveFile;
    public static SaveFile getSaveFile()
    {
        return saveFile;
    }
    public static void setSaveFile(SaveFile saveFile)
    {
        Game.saveFile = saveFile;
    }
    
    private static GameState gameState;
    public static GameState getGameState()
    {
        return gameState;
    }
    public static void setGameState(GameState gameState)
    {
        if (Game.gameState != null)
        {
            Game.gameState.deinitalize();
        }
        
        Game.gameState = gameState;
        Game.gameState.initalize();
    }
    
    public static HeroEvent getHeroEvent()
    {
        return getSaveFile().getHero();
    }
    
}