Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / badguy / mole_rock.cpp
index 1c05ef0..efe5e00 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  MoleRock - Rock thrown by "Mole" Badguy
 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.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 "mole_rock.hpp"
+#include "badguy/mole_rock.hpp"
 
-#include "lisp/writer.hpp"
-#include "object_factory.hpp"
 #include "audio/sound_manager.hpp"
 #include "sprite/sprite.hpp"
+#include "supertux/object_factory.hpp"
 
-MoleRock::MoleRock(const lisp::Lisp& reader)
-        : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
+MoleRock::MoleRock(const Reader& reader)
+  : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
 {
   physic.enable_gravity(true);
   countMe = false;
@@ -36,8 +29,10 @@ MoleRock::MoleRock(const lisp::Lisp& reader)
   sound_manager->preload("sounds/stomp.wav");
 }
 
-MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0)
-        : BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(parent), initial_velocity(velocity)
+MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0) :
+  BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), 
+  parent(parent), 
+  initial_velocity(velocity)
 {
   physic.enable_gravity(true);
   countMe = false;
@@ -45,13 +40,6 @@ MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* pare
   sound_manager->preload("sounds/stomp.wav");
 }
 
-MoleRock::MoleRock(const MoleRock& other)
-        : BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
-{
-  sound_manager->preload("sounds/darthit.wav");
-  sound_manager->preload("sounds/stomp.wav");
-}
-
 MoleRock::~MoleRock()
 {
 }
@@ -67,15 +55,6 @@ MoleRock::updatePointers(const GameObject* from_object, GameObject* to_object)
 }
 
 void
-MoleRock::write(lisp::Writer& writer)
-{
-  writer.start_list("mole_rock");
-  writer.write("x", start_position.x);
-  writer.write("y", start_position.y);
-  writer.end_list("mole_rock");
-}
-
-void
 MoleRock::initialize()
 {
   physic.set_velocity(initial_velocity);
@@ -122,4 +101,6 @@ MoleRock::collision_player(Player& player, const CollisionHit& hit)
   return BadGuy::collision_player(player, hit);
 }
 
-IMPLEMENT_FACTORY(MoleRock, "mole_rock")
+IMPLEMENT_FACTORY(MoleRock, "mole_rock");
+
+/* EOF */