converted player to new object system
[supertux.git] / src / type.h
index 3ae2993..f018f3b 100644 (file)
@@ -1,5 +1,5 @@
 //  $Id$
-// 
+//
 //  SuperTux
 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
 //
@@ -12,7 +12,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -43,32 +43,33 @@ class GameObject
 {
 
 public:
-GameObject() {};
-virtual ~GameObject() {};
-virtual void action(double frame_ratio) = 0;
-virtual void draw() = 0;
-virtual std::string type() = 0;
-/* Draw ignoring the scroll_x value. FIXME: Hack? Should be discussed. @tobgle*/
-void draw_on_screen(float x = -1, float y = -1)
-{
- base_type btmp = base;
- if(x != -1 || y != -1)
- {
- btmp = base;
- if(x != -1)
- base.x = x;
- if(y != -1)
- base.y = y;
- }
- float tmp = scroll_x;
- scroll_x = 0; draw();
- scroll_x = tmp; 
- base = btmp;
-};
-void move_to(float x, float y) { base.x = x; base.y = y; };
+  GameObject() {};
+  virtual ~GameObject() {};
+  virtual void action(double frame_ratio) = 0;
+  virtual void draw() = 0;
+  virtual std::string type() = 0;
+  /* Draw ignoring the scroll_x value. FIXME: Hack? Should be discussed. @tobgle*/
+  void draw_on_screen(float x = -1, float y = -1)
+  {
+    base_type btmp = base;
+    if(x != -1 || y != -1)
+    {
+      btmp = base;
+      if(x != -1)
+        base.x = x;
+      if(y != -1)
+        base.y = y;
+    }
+    float tmp = scroll_x;
+    scroll_x = 0; draw();
+    scroll_x = tmp;
+    base = btmp;
+  };
 
-base_type base;
-base_type old_base;
+  void move_to(float x, float y) { base.x = x; base.y = y; };
+
+  base_type base;
+  base_type old_base;
 };
 
 struct string_list_type
@@ -86,5 +87,7 @@ void  string_list_sort(string_list_type* pstring_list);
 void  string_list_add_item(string_list_type* pstring_list, const char* str);
 void  string_list_free(string_list_type* pstring_list);
 
+
+
 #endif /*SUPERTUX_TYPE_H*/