Ed <icelus2k5@gmail.com>'s worldmap teleporter camera pan patch
[supertux.git] / src / worldmap / sprite_change.hpp
index c572309..4754e27 100644 (file)
@@ -1,8 +1,7 @@
-//  $Id: worldmap.hpp 3327 2006-04-13 15:02:40Z ravu_al_hemio $
+//  $Id$
 //
 //  SuperTux
-//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
-//  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
+//  Copyright (C) 2006 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
@@ -22,6 +21,7 @@
 
 #include <string>
 #include <memory>
+#include <list>
 #include "game_object.hpp"
 #include "lisp/lisp.hpp"
 #include "math/vector.hpp"
@@ -42,7 +42,7 @@ public:
    * should tuxs sprite change when the tile has been completely entered,
    * or already when the tile was just touched
    */
-  bool enter;
+  bool change_on_touch;
   /// sprite to change tux image to
   std::auto_ptr<Sprite> sprite;
   /**
@@ -51,16 +51,36 @@ public:
    * another SpriteChange object.
    */
   std::string stay_action;
+
   /**
-   * should the stayaction be displayed
+   * name of a group in which only one SpriteChange will ever have its stay_action displayed.
+   * Leave empty if you don't care.
    */
-  bool in_stay_action;
+  std::string stay_group;
 
   virtual void draw(DrawingContext& context);
   virtual void update(float elapsed_time);
+
+  /**
+   * Activates the SpriteChange's stay action, if applicable
+   */
+  void set_stay_action();
+
+  /**
+   * Deactivates the SpriteChange's stay action, if applicable
+   */
+  void clear_stay_action();
+
+private:
+  /**
+   * should the stayaction be displayed
+   */
+  bool in_stay_action;
+
+  static std::list<SpriteChange*> all_sprite_changes;
+
 };
 
 }
 
 #endif
-