1// SuperTux - Mole Badguy
2// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17#ifndef HEADER_SUPERTUX_BADGUY_MOLE_HPP
18#define HEADER_SUPERTUX_BADGUY_MOLE_HPP
19
20#include "badguy/badguy.hpp"
21
22class Mole final : public BadGuy
23{
24public:
25 Mole(const ReaderMapping& );
26
27 virtual void kill_fall() override;
28 virtual HitResponse collision_badguy(BadGuy& , const CollisionHit& ) override;
29 virtual bool collision_squished(GameObject& object) override;
30
31 virtual void activate() override;
32 virtual void active_update(float) override;
33
34 virtual bool is_freezable() const override;
35
36 virtual void ignite() override;
37
38 virtual std::string get_class() const override { return "mole"; }
39 virtual std::string get_display_name() const override { return _("Mole"); }
40
41private:
42 enum MoleState {
43 PRE_THROWING,
44 THROWING,
45 POST_THROWING,
46 PEEKING,
47 DEAD,
48 BURNING
49 };
50
51private:
52 void set_state(MoleState new_state);
53 void throw_rock();
54
55private:
56 MoleState state;
57 Timer timer;
58 Timer throw_timer;
59
60private:
61 Mole(const Mole&) = delete;
62 Mole& operator=(const Mole&) = delete;
63};
64
65#endif
66
67/* EOF */
68