///
/// The game manager
///

#ifndef __GAME_MANAGER_H__
#define __GAME_MANAGER_H__

#include <time.h>		/// for time_t

#include "Manager.h"

#define DRAGONFLY_VERSION 1.2
#define DEFAULT_FRAME_TIME 33	/// in milliseconds (33 ms == 30 fps)

class GameManager : public Manager {

 private:
	 GameManager (GameManager const&){}    /// don't allow copy
	 void operator=(GameManager const&){}    /// don't allow assignment
	 			    /// private since a singleton

 protected:
  bool game_over;			    /// true -> game loop should stop

 public:
	 GameManager(){}
  ~GameManager();

  /// Get the singleton instance of the GameManager.
  static GameManager &getInstance();

  /// Startup all the GameManager services.
  /// append = true if add to log file (default false).
  /// flush = true if flush after each write (default false).
  /// seed is optional random seed (default is seed with system time).
  int startUp();
  int startUp(bool append, bool flush);
  int startUp(bool append, bool flush, time_t seed);

  /// Shut down the GameManager services, also terminating the program.
  void shutDown();

  /// Run the game loop.
  /// Frame_time is time between frames (default FRAME_TIME, indicated above).
  void run();
  void run(int frame_time);

  /// Indicate the game is over, which will stop the game loop.
  void setGameOver();
};

#endif // __GAME_MANAGER_H__
