26d95794815c79469396299503fdb8dc863d1a5e
[supertux.git] / src / object / electrifier.hpp
1 //  SuperTux
2 //
3 //  This program is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU General Public License
5 //  as published by the Free Software Foundation; either version 2
6 //  of the License, or (at your option) any later version.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU General Public License for more details.
12 // 
13 //  You should have received a copy of the GNU General Public License
14 //  along with this program; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 //  02111-1307, USA.
17
18 #ifndef __ELECTRIFIER_H__
19 #define __ELECTRIFIER_H__
20
21 #include "resources.hpp"
22 #include "game_object.hpp"
23 #include "timer.hpp"
24
25 //Changes all tiles with the given ID to a new one for a given amount of time, then removes itself
26 //Used by the Kugelblitz to electrify water - can be used for other effects, too
27 class Electrifier : public GameObject
28 {
29 public:
30   Electrifier(uint32_t oldtile, uint32_t newtile, float seconds);
31   ~Electrifier();
32 protected:  
33   virtual void update(float time);
34   virtual void draw(DrawingContext& context);
35 private:
36   uint32_t change_from;
37   uint32_t change_to;
38   Timer duration;
39 };
40
41 #endif
42