Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / trigger / climbable.cpp
index 6f7b039..2045d76 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  SuperTux - Climbable area
 //  Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.expires.deltadevelopment.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 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 3 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
 //  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>
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include "climbable.hpp"
+#include "trigger/climbable.hpp"
 
-#include "game_session.hpp"
-#include "lisp/lisp.hpp"
-#include "lisp/writer.hpp"
-#include "object_factory.hpp"
-#include "main.hpp"
-#include "sector.hpp"
-#include "level.hpp"
-#include "gettext.hpp"
-#include "object/tilemap.hpp"
+#include "object/player.hpp"
+#include "supertux/main.hpp"
+#include "supertux/object_factory.hpp"
+#include "util/gettext.hpp"
+#include "util/reader.hpp"
 
 namespace {
-  const float GRACE_DX = 8; // how far off may the player's bounding-box be x-wise
-  const float GRACE_DY = 8; // how far off may the player's bounding-box be y-wise
-  const float ACTIVATE_TRY_FOR = 1; // how long to try correcting mis-alignment of player and climbable before giving up
-  const float POSITION_FIX_AX = 50; // x-wise acceleration applied to player when trying to align player and Climbable
-  const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable
+const float GRACE_DX = 8; // how far off may the player's bounding-box be x-wise
+const float GRACE_DY = 8; // how far off may the player's bounding-box be y-wise
+const float ACTIVATE_TRY_FOR = 1; // how long to try correcting mis-alignment of player and climbable before giving up
+const float POSITION_FIX_AX = 50; // x-wise acceleration applied to player when trying to align player and Climbable
+const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable
 }
 
-Climbable::Climbable(const lisp::Lisp& reader)
+Climbable::Climbable(const Reader& reader)
   : climbed_by(0)
 {
   reader.get("x", bbox.p1.x);
@@ -64,19 +55,6 @@ Climbable::~Climbable()
   }
 }
 
-void
-Climbable::write(lisp::Writer& writer)
-{
-  writer.start_list("climbable");
-
-  writer.write("x", bbox.p1.x);
-  writer.write("y", bbox.p1.y);
-  writer.write("width", bbox.get_width());
-  writer.write("height", bbox.get_height());
-
-  writer.end_list("climbable");
-}
-
 void 
 Climbable::update(float /*elapsed_time*/)
 {
@@ -136,3 +114,4 @@ Climbable::may_climb(Player& player)
 
 IMPLEMENT_FACTORY(Climbable, "climbable");
 
+/* EOF */