From 17e628b083bee2988a2cbd682d69e7fd3a8581c8 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 14 Sep 2012 20:39:56 +0200 Subject: [PATCH] Added forward declarations (not for library types). --- source/Game.h | 3 +++ source/TileManager.h | 2 ++ source/abstract/Sprite.h | 2 ++ source/effects/Bullet.h | 2 ++ source/items/Weapon.h | 3 +++ source/particle/Emitter.h | 4 ++++ source/particle/Particle.h | 2 ++ source/sprite/Body.h | 2 ++ source/sprite/Cover.h | 2 ++ source/sprite/Enemy.h | 4 ++++ source/sprite/Player.h | 2 ++ source/util/Collection.h | 2 ++ source/util/Loader.h | 3 +++ source/util/ResourceManager.h | 4 ++++ 14 files changed, 37 insertions(+) diff --git a/source/Game.h b/source/Game.h index f38d98d..1c8bef8 100644 --- a/source/Game.h +++ b/source/Game.h @@ -19,6 +19,9 @@ #include "sprite/Player.h" #include "util/Collection.h" +class Player; +class Collection; + /* * Use vertex for tiles. */ diff --git a/source/TileManager.h b/source/TileManager.h index d555770..2a7c4cb 100755 --- a/source/TileManager.h +++ b/source/TileManager.h @@ -19,6 +19,8 @@ #include "util/Vector.h" #include "abstract/Sprite.h" +class Sprite; + class TileManager : public sf::Drawable { // Public constants. public: diff --git a/source/abstract/Sprite.h b/source/abstract/Sprite.h index 2a9b1b1..b345812 100644 --- a/source/abstract/Sprite.h +++ b/source/abstract/Sprite.h @@ -15,6 +15,8 @@ #include "Physical.h" #include "../util/Vector.h" +class Physical; + /** * Represents a drawable object. * diff --git a/source/effects/Bullet.h b/source/effects/Bullet.h index d66bc8c..eb0b858 100755 --- a/source/effects/Bullet.h +++ b/source/effects/Bullet.h @@ -10,6 +10,8 @@ #include "../particle/Particle.h" +class Particle; + /** * Bullet particle fired by a weapon, may damage actors. */ diff --git a/source/items/Weapon.h b/source/items/Weapon.h index aa1b1c1..76d43ab 100755 --- a/source/items/Weapon.h +++ b/source/items/Weapon.h @@ -13,6 +13,9 @@ #include "../abstract/Physical.h" #include "../particle/Emitter.h" +class Physical; +class Emitter; + /** * Loading mechanism: * - pass enum value and load mapped xml diff --git a/source/particle/Emitter.h b/source/particle/Emitter.h index a7cc41b..56cdb06 100755 --- a/source/particle/Emitter.h +++ b/source/particle/Emitter.h @@ -12,6 +12,10 @@ #include "../util/Collection.h" #include "Particle.h" +class Physical; +class Collection; +class Particle; + class Emitter { // Public functions. public: diff --git a/source/particle/Particle.h b/source/particle/Particle.h index 2f8b4b8..e8ad788 100755 --- a/source/particle/Particle.h +++ b/source/particle/Particle.h @@ -10,6 +10,8 @@ #include "../abstract/Sprite.h" +class Sprite; + /** * Prototype for a particle. */ diff --git a/source/sprite/Body.h b/source/sprite/Body.h index 2697886..34c006f 100755 --- a/source/sprite/Body.h +++ b/source/sprite/Body.h @@ -10,6 +10,8 @@ #include "../abstract/Sprite.h" +class Sprite; + class Body : public Sprite { // Public functions. public: diff --git a/source/sprite/Cover.h b/source/sprite/Cover.h index 35f1eb2..d438980 100755 --- a/source/sprite/Cover.h +++ b/source/sprite/Cover.h @@ -10,6 +10,8 @@ #include "../abstract/Sprite.h" +class Sprite; + /** * A wall that can be placed anywhere (not limited by tiles) and have any (rectangular) size. */ diff --git a/source/sprite/Enemy.h b/source/sprite/Enemy.h index fd5e53d..964a1b6 100644 --- a/source/sprite/Enemy.h +++ b/source/sprite/Enemy.h @@ -13,6 +13,10 @@ #include "../util/Collection.h" #include "../util/Vector.h" +class Actor; +class Sprite; +class Collection; + class Enemy : public Sprite, public Actor { // Public functions. public: diff --git a/source/sprite/Player.h b/source/sprite/Player.h index 0a08c6c..b2601ef 100644 --- a/source/sprite/Player.h +++ b/source/sprite/Player.h @@ -16,7 +16,9 @@ #include "../items/Weapon.h" #include "../util/Vector.h" +class Actor; class Sprite; +class Weapon; /** * Player object. diff --git a/source/util/Collection.h b/source/util/Collection.h index 1ce1fa1..be7d778 100755 --- a/source/util/Collection.h +++ b/source/util/Collection.h @@ -15,6 +15,8 @@ #include "../abstract/Sprite.h" +class Sprite; + /** * A collection of sprites, which can be put into different layers. */ diff --git a/source/util/Loader.h b/source/util/Loader.h index 753a8a5..16e5914 100755 --- a/source/util/Loader.h +++ b/source/util/Loader.h @@ -18,6 +18,9 @@ #include "Singleton.h" +template +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 diff --git a/source/util/ResourceManager.h b/source/util/ResourceManager.h index b84289a..053de44 100644 --- a/source/util/ResourceManager.h +++ b/source/util/ResourceManager.h @@ -14,6 +14,10 @@ #include "Singleton.h" +template +class Singleton; + + /** * Loads and manages all resources by providing Singleton access to Thor ResourceManager. */