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

67 lines
1.1 KiB
C
Raw Normal View History

/*
* Game.h
*
* Created on: 05.07.2012
* Author: Felix
*/
#ifndef DG_GAME_H_
#define DG_GAME_H_
2012-12-22 14:10:26 +00:00
#include <string>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <Thor/Resources.hpp>
2012-10-14 16:14:06 +00:00
#include "sprites/TileManager.h"
#include "sprites/Player.h"
2012-12-22 13:56:17 +00:00
#include "World.h"
class Player;
2012-12-22 13:56:17 +00:00
class World;
/*
* Use vertex for tiles.
*/
class Game : private sf::NonCopyable {
// Public functions.
public:
2012-10-01 08:47:42 +00:00
Game(sf::RenderWindow& window);
~Game();
void loop();
// Private functions.
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);
void generate();
sf::Vector2<float> convertCoordinates(int x, int y);
// Private variables.
private:
static const int FPS_GOAL;
2012-10-01 08:47:42 +00:00
sf::RenderWindow& mWindow;
sf::Clock mClock;
sf::View mView;
2012-12-22 13:56:17 +00:00
World mWorld;
TileManager mTileManager;
2012-12-22 13:56:17 +00:00
std::shared_ptr<Player> mPlayer;
bool mQuit;
bool mPaused;
};
#endif /* DG_GAME_H_ */