00001 // SuperTux 00002 // Copyright (C) 2006 Matthias Braun <matze@braunis.de> 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #ifndef HEADER_SUPERTUX_WORLDMAP_SPRITE_CHANGE_HPP 00018 #define HEADER_SUPERTUX_WORLDMAP_SPRITE_CHANGE_HPP 00019 00020 #include <list> 00021 #include <memory> 00022 #include <string> 00023 00024 #include "util/reader_fwd.hpp" 00025 #include "math/vector.hpp" 00026 #include "supertux/game_object.hpp" 00027 00028 class Sprite; 00029 00030 namespace worldmap { 00031 00032 class SpriteChange : public GameObject 00033 { 00034 public: 00035 SpriteChange(const Reader& lisp); 00036 virtual ~SpriteChange(); 00037 00038 virtual void draw(DrawingContext& context); 00039 virtual void update(float elapsed_time); 00040 00044 void set_stay_action(); 00045 00049 void clear_stay_action(); 00050 00051 public: 00052 Vector pos; 00053 00056 bool change_on_touch; 00057 00059 SpritePtr sprite; 00060 00064 std::string stay_action; 00065 00068 std::string stay_group; 00069 00070 private: 00072 bool in_stay_action; 00073 00074 private: 00075 static std::list<SpriteChange*> all_sprite_changes; 00076 }; 00077 00078 } // namespace worldmap 00079 00080 #endif 00081 00082 /* EOF */