Cleaned includes in .h files.
This commit is contained in:
parent
30de9e397b
commit
6e631e78d5
21 changed files with 24 additions and 64 deletions
|
@ -12,7 +12,8 @@
|
|||
#include <Thor/Graphics.hpp>
|
||||
|
||||
#include "abstract/Character.h"
|
||||
#include "sprites/Enemy.h"
|
||||
#include "sprites/Enemy.h"
|
||||
#include "sprites/Player.h"
|
||||
#include "util/Loader.h"
|
||||
#include "util/ResourceManager.h"
|
||||
#include "util/Yaml.h"
|
||||
|
|
|
@ -8,15 +8,7 @@
|
|||
#ifndef DG_GAME_H_
|
||||
#define DG_GAME_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <SFML/System.hpp>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
#include <Thor/Resources.hpp>
|
||||
|
||||
#include "sprites/TileManager.h"
|
||||
#include "sprites/Player.h"
|
||||
#include "World.h"
|
||||
|
||||
class TileManager;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#ifndef DG_WORLD_H_
|
||||
#define DG_WORLD_H_
|
||||
|
||||
#include "abstract/Sprite.h"
|
||||
#include "abstract/Character.h"
|
||||
#include "abstract/Sprite.h"
|
||||
|
||||
class Character;
|
||||
class Sprite;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../sprites/Corpse.h"
|
||||
#include "../util/Log.h"
|
||||
#include "../util/Yaml.h"
|
||||
#include "../World.h"
|
||||
|
||||
const std::string Character::KEY_HEALTH = "health";
|
||||
const int Character::DEFAULT_HEALTH = 100;
|
||||
|
|
|
@ -8,14 +8,10 @@
|
|||
#ifndef DG_ACTOR_H_
|
||||
#define DG_ACTOR_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Sprite.h"
|
||||
|
||||
class World;
|
||||
class Weapon;
|
||||
class Sprite;
|
||||
class Yaml;
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef DG_SINGLETON_H_
|
||||
#define DG_SINGLETON_H_
|
||||
|
||||
#include <SFML/System.hpp>
|
||||
|
||||
/**
|
||||
* Template class for inheriting singleton behaviour.
|
||||
*
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../abstract/Character.h"
|
||||
#include "../util/Loader.h"
|
||||
#include "../util/ResourceManager.h"
|
||||
#include "../util/Yaml.h"
|
||||
|
||||
const std::string Bullet::KEY_DAMAGE = "damage";
|
||||
const int Bullet::DEFAULT_DAMAGE = 10;
|
||||
|
|
|
@ -8,12 +8,8 @@
|
|||
#ifndef DG_BULLET_H_
|
||||
#define DG_BULLET_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../particle/Particle.h"
|
||||
#include "../util/Yaml.h"
|
||||
|
||||
class Particle;
|
||||
class Yaml;
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "../World.h"
|
||||
#include "../effects/Bullet.h"
|
||||
#include "../util/Yaml.h"
|
||||
|
||||
const std::string Weapon::KEY_BULLET = "bullet";
|
||||
const std::string Weapon::DEFAULT_BULLET = "bullet.yaml";
|
||||
|
@ -78,11 +79,11 @@ Weapon::onThink(int elapsed) {
|
|||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Particle>
|
||||
std::shared_ptr<Sprite>
|
||||
Weapon::createParticle() {
|
||||
// Minus to account for positive y-axis going downwards in SFML.
|
||||
sf::Vector2f offset(- mOffset);
|
||||
thor::rotate(offset, mHolder.getAngle());
|
||||
return std::shared_ptr<Particle>(new Bullet(mHolder.getPosition() + offset,
|
||||
return std::shared_ptr<Sprite>(new Bullet(mHolder.getPosition() + offset,
|
||||
mHolder, mHolder.getAngle(), Yaml(mBullet)));
|
||||
}
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
#ifndef DG_WEAPON_H_
|
||||
#define DG_WEAPON_H_
|
||||
|
||||
#include <Thor/Particles.hpp>
|
||||
#include <string>
|
||||
|
||||
#include <SFML/System.hpp>
|
||||
|
||||
#include "../particle/Emitter.h"
|
||||
|
||||
|
@ -33,7 +35,7 @@ public:
|
|||
|
||||
// Protected functions.
|
||||
protected:
|
||||
std::shared_ptr<Particle> createParticle();
|
||||
std::shared_ptr<Sprite> createParticle();
|
||||
|
||||
// Private variables.
|
||||
private:
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
#include "Emitter.h"
|
||||
|
||||
Emitter::Emitter(World& collection) :
|
||||
mCollection(collection) {
|
||||
#include "../World.h"
|
||||
|
||||
Emitter::Emitter(World& world) :
|
||||
mWorld(world) {
|
||||
}
|
||||
|
||||
Emitter::~Emitter() {
|
||||
|
@ -19,5 +21,5 @@ Emitter::~Emitter() {
|
|||
*/
|
||||
void
|
||||
Emitter::emit() {
|
||||
mCollection.insert(createParticle());
|
||||
mWorld.insert(createParticle());
|
||||
}
|
||||
|
|
|
@ -8,27 +8,27 @@
|
|||
#ifndef DG_EMITTER_H_
|
||||
#define DG_EMITTER_H_
|
||||
|
||||
#include "../World.h"
|
||||
#include "Particle.h"
|
||||
#include <memory>
|
||||
|
||||
class World;
|
||||
class Particle;
|
||||
class Sprite;
|
||||
|
||||
class Emitter {
|
||||
// Public functions.
|
||||
public:
|
||||
Emitter(World& collection);
|
||||
Emitter(World& world);
|
||||
virtual ~Emitter();
|
||||
|
||||
// Protected functions.
|
||||
protected:
|
||||
void emit();
|
||||
/// Creates a particle. Allows to use a user-defined particle class and custom settings.
|
||||
virtual std::shared_ptr<Particle> createParticle() = 0;
|
||||
virtual std::shared_ptr<Sprite> createParticle() = 0;
|
||||
|
||||
// Private variables.
|
||||
private:
|
||||
World& mCollection;
|
||||
World& mWorld;
|
||||
};
|
||||
|
||||
#endif /* DG_EMITTER_H_ */
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
#define DG_PARTICLE_H_
|
||||
|
||||
#include "../abstract/Sprite.h"
|
||||
#include "../util/Yaml.h"
|
||||
|
||||
class Sprite;
|
||||
class Yaml;
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "../abstract/Sprite.h"
|
||||
|
||||
class Sprite;
|
||||
class Yaml;
|
||||
|
||||
class Corpse : public Sprite {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include "../abstract/Character.h"
|
||||
|
||||
class Character;
|
||||
class World;
|
||||
class Yaml;
|
||||
|
||||
|
|
|
@ -8,13 +8,10 @@
|
|||
#ifndef DG_PLAYER_H_
|
||||
#define DG_PLAYER_H_
|
||||
|
||||
#include <SFML/System.hpp>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
#include "../abstract/Character.h"
|
||||
|
||||
class Character;
|
||||
class Yaml;
|
||||
class World;
|
||||
|
||||
/**
|
||||
* Player object.
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../util/Loader.h"
|
||||
#include "../util/ResourceManager.h"
|
||||
#include "../util/Yaml.h"
|
||||
#include "../World.h"
|
||||
|
||||
const sf::Vector2i TileManager::TILE_SIZE = sf::Vector2i(100, 100);
|
||||
|
||||
|
|
|
@ -8,15 +8,9 @@
|
|||
#ifndef DG_TILEMANAGER_H_
|
||||
#define DG_TILEMANAGER_H_
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "../World.h"
|
||||
#include "../abstract/Sprite.h"
|
||||
#include <string>
|
||||
|
||||
class World;
|
||||
class Sprite;
|
||||
|
||||
class TileManager : public sf::Drawable {
|
||||
// Public types.
|
||||
|
|
|
@ -8,19 +8,10 @@
|
|||
#ifndef DG_LOADER_H_
|
||||
#define DG_LOADER_H_
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include <SFML/System.hpp>
|
||||
|
||||
#include <Thor/Resources.hpp>
|
||||
|
||||
#include "../abstract/Singleton.h"
|
||||
|
||||
template <class T>
|
||||
class Singleton;
|
||||
|
||||
/**
|
||||
* This class allows to set default resource folders and subfolders, which means that these
|
||||
* folders only have to be set once, and not be included in the creation of every single
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef DG_LOG_H_
|
||||
#define DG_LOG_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* Logging functions for different levels.
|
||||
*
|
||||
|
|
|
@ -8,15 +8,8 @@
|
|||
#ifndef DG_RESOURCEMANAGER_H_
|
||||
#define DG_RESOURCEMANAGER_H_
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
#include <Thor/Resources.hpp>
|
||||
|
||||
#include "../abstract/Singleton.h"
|
||||
|
||||
template <class T>
|
||||
class Singleton;
|
||||
|
||||
/**
|
||||
* Loads and manages all resources by providing Singleton access to Thor ResourceManager.
|
||||
*/
|
||||
|
|
Reference in a new issue