Coverage Summary for Class: GameState (io.github.unisim)
| Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
| GameState |
0%
(0/1)
|
0%
(0/5)
|
0%
(0/4)
|
0%
(0/28)
|
package io.github.unisim;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import io.github.unisim.ui.AchievementScreen;
import io.github.unisim.ui.GameOverScreen;
import io.github.unisim.ui.GameScreen;
import io.github.unisim.ui.HowToPlayScreen;
import io.github.unisim.ui.LeaderboardScreen;
import io.github.unisim.ui.SettingsScreen;
import io.github.unisim.ui.StartMenuScreen;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.Stack;
/**
* Contains a collection of settings and references that should be available
* globally.
*/
public class GameState {
public static Color UIPrimaryColour = new Color(0.250f, 0.326f, 0.865f, 1.0f);
public static Color UISecondaryColour = new Color(0.722f, 0.646f, 0.953f, 1.0f);
public static Skin defaultSkin = new Skin(Gdx.files.internal("ui/uiskin.json"));
public static Skin altSkin = new Skin(Gdx.files.internal("ui/vhs-ui.json"));
public static MusicManager musicManager = new MusicManager();
public static Settings settings = new Settings();
public static InputProcessor fullscreenInputProcessor = new FullscreenInputProcessor();
public static Screen gameScreen = new GameScreen();
public static Screen startScreen = new StartMenuScreen();
public static Screen settingScreen = new SettingsScreen();
public static Screen achievementScreen = new AchievementScreen();
public static Screen leaderboardScreen = new LeaderboardScreen();
public static Screen gameOverScreen = new GameOverScreen();
public static Screen howToPlayScreen = new HowToPlayScreen();
public static Screen currentScreen;
public static GameOverData gameOverData = new GameOverData();
private static Stack<Screen> screenStack = new Stack<>();
// Create an unmodifiable set containing the IDs of all buildable tiles
// we use a set to make searching more efficient
public static Set<Integer> buildableTiles = Stream.of(
14, 15).collect(Collectors.toUnmodifiableSet());
public static boolean paused = true;
public static boolean gameOver = false;
public static void restartGame() {
gameScreen = new GameScreen();
currentScreen = gameScreen;
}
public static void pushScreen(Screen screen) {
// Pushes the current screen onto a stack
if (currentScreen != null) {
screenStack.push(currentScreen);
}
currentScreen = screen;
}
public static void popScreen() {
// Pops a screen from the stack
if (!screenStack.isEmpty()) {
currentScreen = screenStack.pop();
}
}
}