Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / badguy / darttrap.cpp
index 8d78c97..3e66642 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  DartTrap - Shoots a Dart at regular intervals
 //  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 "darttrap.hpp"
-#include "dart.hpp"
+#include "badguy/dart.hpp"
+#include "badguy/darttrap.hpp"
 
-#include "object_factory.hpp"
 #include "audio/sound_manager.hpp"
-#include "lisp/writer.hpp"
-#include "sector.hpp"
-#include "lisp/lisp.hpp"
 #include "sprite/sprite.hpp"
+#include "supertux/object_factory.hpp"
+#include "supertux/sector.hpp"
 
 namespace {
-  const float MUZZLE_Y = 25; /**< [px] muzzle y-offset from top */
+const float MUZZLE_Y = 25; /**< [px] muzzle y-offset from top */
 }
 
-DartTrap::DartTrap(const lisp::Lisp& reader)
-  : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
+DartTrap::DartTrap(const Reader& reader) :
+  BadGuy(reader, "images/creatures/darttrap/darttrap.sprite", LAYER_TILES-1),
+  initial_delay(0), 
+  fire_delay(2), 
+  ammo(-1), 
+  state(IDLE),
+  fire_timer()
 {
   reader.get("initial-delay", initial_delay);
   reader.get("fire-delay", fire_delay);
@@ -48,18 +46,6 @@ DartTrap::DartTrap(const lisp::Lisp& reader)
 }
 
 void
-DartTrap::write(lisp::Writer& writer)
-{
-  writer.start_list("darttrap");
-  writer.write("x", start_position.x);
-  writer.write("y", start_position.y);
-  writer.write("initial-delay", initial_delay);
-  writer.write("fire-delay", fire_delay);
-  writer.write("ammo", ammo);
-  writer.end_list("darttrap");
-}
-
-void
 DartTrap::initialize()
 {
   sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
@@ -115,4 +101,6 @@ DartTrap::fire()
   sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
 }
 
-IMPLEMENT_FACTORY(DartTrap, "darttrap")
+IMPLEMENT_FACTORY(DartTrap, "darttrap");
+
+/* EOF */