DEADSOFTWARE

0219655c9c83f109ec6f862b542517b2ff6d9b50
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / MainConfig.java
1 package ru.deadsoftware.cavedroid;
3 import ru.deadsoftware.cavedroid.game.GameUiWindow;
4 import ru.deadsoftware.cavedroid.game.input.Joystick;
6 import javax.annotation.CheckForNull;
7 import javax.annotation.Nullable;
8 import javax.inject.Inject;
9 import javax.inject.Singleton;
11 @Singleton
12 public class MainConfig {
14 private final CaveGame mCaveGame;
16 @CheckForNull
17 private MainComponent mMainComponent;
19 @CheckForNull
20 private Joystick mJoystick;
22 private GameUiWindow mGameUiWindow;
23 private String mGameFolder;
25 private boolean mTouch;
26 private boolean mShowInfo;
27 private boolean mShowMap;
29 private float mWidth;
30 private float mHeight;
32 @Nullable
33 private String mAssetsPackPath = null;
35 @Inject
36 public MainConfig(CaveGame caveGame) {
37 mCaveGame = caveGame;
39 mGameUiWindow = GameUiWindow.NONE;
40 mGameFolder = "";
41 }
43 public CaveGame getCaveGame() {
44 return mCaveGame;
45 }
47 public MainComponent getMainComponent() {
48 assert mMainComponent != null;
49 return mMainComponent;
50 }
52 public void setMainComponent(MainComponent mainComponent) {
53 mMainComponent = mainComponent;
54 }
56 public boolean checkGameUiWindow(GameUiWindow gameUiWindow) {
57 return mGameUiWindow == gameUiWindow;
58 }
60 public void setGameUiWindow(GameUiWindow gameUiWindow) {
61 mGameUiWindow = gameUiWindow;
62 }
64 public String getGameFolder() {
65 return mGameFolder;
66 }
68 public void setGameFolder(String gameFolder) {
69 mGameFolder = gameFolder;
70 }
72 public boolean isTouch() {
73 return mTouch;
74 }
76 public void setTouch(boolean touch) {
77 mTouch = touch;
78 }
80 public float getWidth() {
81 return mWidth;
82 }
84 public void setWidth(float width) {
85 mWidth = width;
86 }
88 public float getHeight() {
89 return mHeight;
90 }
92 public void setHeight(float height) {
93 mHeight = height;
94 }
96 public boolean isShowInfo() {
97 return mShowInfo;
98 }
100 public void setShowInfo(boolean showInfo) {
101 mShowInfo = showInfo;
104 public boolean isShowMap() {
105 return mShowMap;
108 public void setShowMap(boolean showMap) {
109 mShowMap = showMap;
112 @Nullable
113 public String getAssetsPackPath() {
114 return mAssetsPackPath;
117 public void setAssetsPackPath(@Nullable String assetsPackPath) {
118 mAssetsPackPath = assetsPackPath;
121 @CheckForNull
122 public Joystick getJoystick() {
123 return mJoystick;
126 public void setJoystick(@CheckForNull Joystick joystick) {
127 mJoystick = joystick;