Commits

Ivan Vučica committed 56a8c82

getOwnerLevel() utility function that actually accesses and casts gGame.

Comments (0)

Files changed (3)

 #include "bullet.h"
 #include "texture.h"
 #include "playership.h"
-
+#include "gm_level.h"
 
 Bullet::Bullet( double argX, double argY) : x(argX), y(argY), texture(new Texture("bullet.png"))
 {
 {
 	this->x+=100 * timeDelta;
 
+    GM_Level * ownerLevel = this->getOwnerLevel();
 }
 
 
 #include "gameobject.h"
+#include "gamemode.h"
+
+GM_Level *
+GameObject::getOwnerLevel()
+{
+    return (GM_Level*)gGame;
+}
 
 #include <SDL/SDL.h>
 
+class GM_Level;
+
 class GameObject
 {
     public:
     {
     }
 
+    GM_Level * getOwnerLevel();
+    
     private:
 };