1 /*
2  * Copyright (C) 2006-2019 Christopho, Solarus - http://www.solarus-games.org
3  *
4  * Solarus 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  * Solarus 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 along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef SOLARUS_HERO_STATE_H
18 #define SOLARUS_HERO_STATE_H
19 
20 #include "solarus/core/Common.h"
21 #include "solarus/entities/EntityState.h"
22 
23 namespace Solarus {
24 
25 /**
26  * \brief The hero base state.
27  */
28 class HeroState: public Entity::State {
29 
30   public:
31 
32     virtual Hero& get_entity() override;
33     virtual const Hero& get_entity() const override;
34     const HeroSprites& get_sprites() const;
35     HeroSprites& get_sprites();
36 
37     void draw_on_map() override;
38 
39     void notify_attack_command_pressed() override;
40     void notify_item_command_pressed(int slot) override;
41 
42     bool is_block_obstacle(Block& block) override;
43     bool is_raised_block_obstacle(CrystalBlock& raised_block) override;
44     bool is_jumper_obstacle(Jumper& jumper, const Rectangle& candidate_position) override;
45 
46   protected:
47 
48     HeroState(Hero& hero, const std::string& state_name);
49     explicit HeroState(const std::string& state_name);
50 
51 };
52 
53 }
54 
55 #endif
56 
57