Commit afa53a2d authored by Turid Cecilie Dahl's avatar Turid Cecilie Dahl
Browse files

Moves GSM out of states

parent 8c5a57f4
package com.gameware.game.states;
package com.gameware.game;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gameware.game.states.State;
import java.util.Stack;
......
......@@ -13,7 +13,6 @@ import com.badlogic.gdx.utils.JsonValue;
import com.gameware.game.models.Game;
import com.gameware.game.models.LocalStorage;
import com.gameware.game.models.Player;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.states.menus.LoginState;
import com.gameware.game.states.menus.MenuState;
import com.gameware.game.states.games.PlayStateUnion;
......
......@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gameware.game.GameStateManager;
import com.gameware.game.GameWare;
import com.gameware.game.sprites.pauseStateSprites.ConfirmationBox;
import com.gameware.game.sprites.LoadingText;
......
......@@ -5,6 +5,7 @@ import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.gameware.game.GameStateManager;
import com.gameware.game.GameWare;
/*
......
......@@ -4,7 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gameware.game.sprites.bubbleWrapSprites.Bubble;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.util.ArrayList;
......
......@@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.gameware.game.sprites.colorRushSprites.ColorRushButton;
import com.gameware.game.sprites.colorRushSprites.ColorRushTarget;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.util.ArrayList;
import java.util.Collections;
......
......@@ -8,7 +8,7 @@ import com.badlogic.gdx.math.Vector3;
import com.gameware.game.GameWare;
import com.gameware.game.sprites.fruitSlicerSprites.Fruit;
import com.gameware.game.sprites.fruitSlicerSprites.SlicingCircle;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.util.ArrayList;
import java.util.List;
......
......@@ -15,7 +15,7 @@ import com.gameware.game.models.Tournament;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.sprites.PauseButton;
import com.gameware.game.states.menus.FinishedTournamentState;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import com.gameware.game.states.PauseState;
import com.gameware.game.states.menus.ScoreState;
import com.gameware.game.states.menus.SinglePlayerSelectGameState;
......
......@@ -21,7 +21,7 @@ import com.gameware.game.models.Alert;
import com.gameware.game.models.Round;
import com.gameware.game.models.Tournament;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.io.IOException;
import java.util.ArrayList;
......
......@@ -22,7 +22,7 @@ import com.gameware.game.models.Game;
import com.gameware.game.models.Round;
import com.gameware.game.models.Tournament;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.io.IOException;
import java.util.ArrayList;
......
......@@ -14,7 +14,7 @@ import com.gameware.game.GameWare;
import com.gameware.game.QueryIntermediate;
import com.gameware.game.models.Point;
import com.gameware.game.models.Tournament;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.util.ArrayList;
import java.util.List;
......
......@@ -14,7 +14,7 @@ import com.gameware.game.GameWare;
import com.gameware.game.QueryIntermediate;
import com.gameware.game.models.Player;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.io.IOException;
import java.util.NoSuchElementException;
......
......@@ -14,7 +14,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.gameware.game.GameWare;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
/*
The main menu state, where players can either choose sinple-player, multiplayer, high scores,
......
......@@ -17,7 +17,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Align;
import com.gameware.game.GameWare;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import com.gameware.game.states.State;
......
......@@ -10,7 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Scaling;
import com.gameware.game.GameWare;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
/*
State where players can edit the options of the game
......
......@@ -10,7 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.Align;
import com.gameware.game.GameWare;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import com.gameware.game.states.State;
/*
......
......@@ -11,8 +11,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.gameware.game.GameWare;
import com.gameware.game.models.Game;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.states.State;
import com.gameware.game.GameStateManager;
import com.gameware.game.states.games.PlayStateUnion;
import java.io.IOException;
......@@ -117,7 +116,7 @@ public class SinglePlayerSelectGameState extends MenuStateUnion {
return backBtn;
}
private void handleGameBtnClick(State state){
private void handleGameBtnClick(PlayStateUnion state){
if(GameWare.getInstance().isSoundEffectsOn()){ buttonPressSound.play(); }
gsm.set(state);
}
......@@ -137,7 +136,7 @@ public class SinglePlayerSelectGameState extends MenuStateUnion {
@Override
public void clicked(InputEvent event, float x, float y) {
Map<String, PlayStateUnion> map = GameWare.getInstance().getGameIdToPlayState();
State s = map.get(game.getId());
PlayStateUnion s = map.get(game.getId());
handleGameBtnClick(s);
};
}
......
......@@ -13,7 +13,7 @@ import com.gameware.game.QueryIntermediate;
import com.gameware.game.models.Point;
import com.gameware.game.models.Round;
import com.gameware.game.models.Tournament;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.util.ArrayList;
import java.util.List;
......
......@@ -12,7 +12,7 @@ import com.gameware.game.GameWare;
import com.gameware.game.QueryIntermediate;
import com.gameware.game.models.Game;
import com.gameware.game.models.Highscore;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.io.IOException;
import java.util.ArrayList;
......
......@@ -17,7 +17,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.gameware.game.GameWare;
import com.gameware.game.models.Game;
import com.gameware.game.sprites.LoadingText;
import com.gameware.game.states.GameStateManager;
import com.gameware.game.GameStateManager;
import java.io.IOException;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment