-Started to move stuff from library back to main game
[supertux.git] / src / object / platform.cpp
index e1a868d..77d428f 100644 (file)
@@ -1,18 +1,40 @@
+//  $Id$
+// 
+//  SuperTux
+//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  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
+//  02111-1307, USA.
+
 #include <config.h>
 
 #include "platform.h"
 #include "video/drawing_context.h"
 #include "resources.h"
 #include "player.h"
-#include "special/sprite_manager.h"
-#include "utils/lispreader.h"
+#include "sprite/sprite_manager.h"
+#include "lisp/lisp.h"
+#include "lisp/writer.h"
+#include "object_factory.h"
 
-Platform::Platform(LispReader& reader)
+Platform::Platform(const lisp::Lisp& reader)
 {
   sprite = sprite_manager->create("flying_platform");
   movement = Vector(0, 1);
-  reader.read_float("x", bbox.p1.x);
-  reader.read_float("y", bbox.p1.y);
+  reader.get("x", bbox.p1.x);
+  reader.get("y", bbox.p1.y);
   bbox.set_size(sprite->get_width(), sprite->get_height());
 
   flags |= FLAG_SOLID;
@@ -26,7 +48,7 @@ Platform::~Platform()
 }
 
 HitResponse
-Platform::collision(GameObject& object, const CollisionHit& hit)
+Platform::collision(GameObject& , const CollisionHit& )
 {
 #if 0
   if(typeid(object) == typeid(Player)) {
@@ -38,7 +60,7 @@ Platform::collision(GameObject& object, const CollisionHit& hit)
 }
 
 void
-Platform::action(float elapsed_time)
+Platform::action(float )
 {
   // just some test code...
   if(state == 0) {
@@ -73,3 +95,5 @@ Platform::draw(DrawingContext& context)
 {
   sprite->draw(context, get_pos(), LAYER_OBJECTS);
 }
+
+IMPLEMENT_FACTORY(Platform, "flying_platform");