//  BlockyFroggy
//  Copyright © 2017 John Ryland.
//  All rights reserved.
#pragma once
#ifndef GAME_SCREEN_H
#define GAME_SCREEN_H


#include "GameSim.h"
#include "Dialog.h"
#include "Lua.h"
class GameGraphics;
class BaseGameState;


class GameScreen
{
public:
  GameScreen();
  ~GameScreen();
  
  void initialize();
  void shutdown();
  void freeSpace(); // evict garbage

  void update(float a_elapsed, float a_aspect);
  void draw();

  void touchDown(float a_x, float a_y);
  void touchUp(float a_x, float a_y);
  void touchMove(float a_x, float a_y);

private:
  // Game state
  typedef std::map<std::string,BaseGameState*>  StageMap;
  StageMap       m_stageMap;
  BaseGameState *m_currentState = nullptr;
  std::string    m_stage;
  void stateTransition(std::string oldState, std::string newState);

  // 3D graphics
  GameGraphics  *m_graphicsPtr;
  GameGraphics  &m_graphics;

  // HUD 2D graphics (overlays on top of the 3D graphics)
  //HUDGraphics    m_hud;

  // Ui
  GameUi::Ui     m_ui;

  // Lua scripting
  //LuaVM          m_lua;
};


#endif // GAME_SCREEN_H

