X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fworldmap%2Fsprite_change.hpp;h=4754e279fe8650b8134d382ce60ae312ac79870d;hb=8b8e1c3576cedddb1d88eafa5fd4804e8257793c;hp=c572309d468c81051c50f67de469ecc6a412eaee;hpb=112f01454123c94f5627200c6819b219026f0af0;p=supertux.git diff --git a/src/worldmap/sprite_change.hpp b/src/worldmap/sprite_change.hpp index c572309d4..4754e279f 100644 --- a/src/worldmap/sprite_change.hpp +++ b/src/worldmap/sprite_change.hpp @@ -1,8 +1,7 @@ -// $Id: worldmap.hpp 3327 2006-04-13 15:02:40Z ravu_al_hemio $ +// $Id$ // // SuperTux -// Copyright (C) 2004 Ingo Ruhnke -// Copyright (C) 2006 Christoph Sommer +// Copyright (C) 2006 Matthias Braun // // 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 #include +#include #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; /** @@ -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 all_sprite_changes; + }; } #endif -