2a1fa0f39a4d50cc3c14a6d478a10f4f1052db91
[supertux.git] / src / badguy / mole.hpp
1 //  $Id$
2 //
3 //  SuperTux - Mole Badguy
4 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 #ifndef __MOLE_H__
21 #define __MOLE_H__
22
23 #include "badguy.hpp"
24
25 class Mole : public BadGuy
26 {
27 public:
28   Mole(const lisp::Lisp& );
29   Mole(const Vector& pos);
30
31   void kill_fall();
32   HitResponse collision_badguy(BadGuy& , const CollisionHit& );
33   bool collision_squished(GameObject& object);
34
35   void activate();
36   void write(lisp::Writer& );
37   void active_update(float);
38
39   virtual Mole* clone() const { return new Mole(*this); }
40
41 private:
42   enum MoleState {
43     PRE_THROWING,
44     THROWING,
45     POST_THROWING,
46     PEEKING,
47     DEAD
48   };
49
50   MoleState state;
51   Timer timer;
52   Timer throw_timer;
53
54   void set_state(MoleState new_state);
55   void throw_rock();
56
57 };
58
59 #endif