This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/Game.h

60 lines
1 KiB
C
Raw Normal View History

/*
* Game.h
*
* Created on: 05.07.2012
* Author: Felix
*/
#ifndef DG_GAME_H_
#define DG_GAME_H_
#include <TGUI/TGUI.hpp>
2013-04-29 14:49:16 +00:00
#include "generator/Generator.h"
2013-04-28 16:11:39 +00:00
#include "Pathfinder.h"
2012-12-22 13:56:17 +00:00
#include "World.h"
class Player;
/*
2013-04-04 21:54:17 +00:00
* High level game managing, including game loop, input, high
* level rendering, and general class handling
*/
class Game : private sf::NonCopyable {
public:
explicit Game(tgui::Window& window);
~Game();
void loop();
private:
void input();
void render();
void keyDown(const sf::Event& event);
void keyUp(const sf::Event& event);
2012-12-24 00:14:22 +00:00
void mouseDown(const sf::Event& event);
void mouseUp(const sf::Event& event);
sf::Vector2<float> convertCoordinates(int x, int y);
void setAmmoText();
private:
static const int FPS_GOAL;
tgui::Window& mWindow;
sf::Clock mClock;
sf::View mWorldView;
tgui::Label* mAmmo;
2012-12-22 13:56:17 +00:00
World mWorld;
2013-04-28 16:11:39 +00:00
Pathfinder mPathfinder;
2013-04-29 14:49:16 +00:00
Generator mGenerator;
2012-12-22 13:56:17 +00:00
std::shared_ptr<Player> mPlayer;
bool mQuit;
bool mPaused;
};
#endif /* DG_GAME_H_ */