mole.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef HEADER_SUPERTUX_BADGUY_MOLE_HPP
  17. #define HEADER_SUPERTUX_BADGUY_MOLE_HPP
  18. #include "badguy/badguy.hpp"
  19. class Mole final : public BadGuy
  20. {
  21. public:
  22. Mole(const ReaderMapping& );
  23. virtual void kill_fall() override;
  24. virtual HitResponse collision_badguy(BadGuy& , const CollisionHit& ) override;
  25. virtual bool collision_squished(GameObject& object) override;
  26. virtual void activate() override;
  27. virtual void active_update(float) override;
  28. virtual bool is_freezable() const override;
  29. virtual void ignite() override;
  30. virtual std::string get_class() const override { return "mole"; }
  31. virtual std::string get_display_name() const override { return _("Mole"); }
  32. private:
  33. enum MoleState {
  34. PRE_THROWING,
  35. THROWING,
  36. POST_THROWING,
  37. PEEKING,
  38. DEAD,
  39. BURNING
  40. };
  41. private:
  42. void set_state(MoleState new_state);
  43. void throw_rock();
  44. private:
  45. MoleState state;
  46. Timer timer;
  47. Timer throw_timer;
  48. private:
  49. Mole(const Mole&) = delete;
  50. Mole& operator=(const Mole&) = delete;
  51. };
  52. #endif
  53. /* EOF */