Horizon Official Technical Documentation
NPC.hpp
Go to the documentation of this file.
1/***************************************************
2 * _ _ _ *
3 * | | | | (_) *
4 * | |_| | ___ _ __ _ _______ _ __ *
5 * | _ |/ _ \| '__| |_ / _ \| '_ \ *
6 * | | | | (_) | | | |/ / (_) | | | | *
7 * \_| |_/\___/|_| |_/___\___/|_| |_| *
8 ***************************************************
9 * This file is part of Horizon (c).
10 *
11 * Copyright (c) 2019 Sagun K. (sagunxp@gmail.com).
12 * Copyright (c) 2019 Horizon Dev Team.
13 *
14 * Base Author - Sagun K. (sagunxp@gmail.com)
15 *
16 * This library is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this library. If not, see <http://www.gnu.org/licenses/>.
28 **************************************************/
29
30#ifndef HORIZON_ZONE_GAME_ENTITIES_NPC_HPP
31#define HORIZON_ZONE_GAME_ENTITIES_NPC_HPP
32
36
37
38
39namespace Horizon
40{
41namespace Zone
42{
43namespace Units
44{
45class NPC : public Unit, public GridObject<NPC>
46{
47public:
48 NPC(std::string const &name, std::shared_ptr<Map> map, uint16_t x, uint16_t y, uint32_t job_id, directions dir);
49 NPC(std::string const &name, std::shared_ptr<Map> map, uint16_t x, uint16_t y, uint32_t job_id, directions dir, std::string const &script_file);
50 NPC(std::string const &name, std::shared_ptr<Map> map, uint16_t x, uint16_t y, uint32_t job_id, directions dir, std::shared_ptr<NPC> duplicate);
51 NPC(std::string const &name, std::shared_ptr<Map> map, uint16_t x, uint16_t y, std::string const &script);
52 ~NPC();
53
54 bool initialize();
55
56 void stop_movement() override;
57 void on_pathfinding_failure() override;
58 void on_movement_begin(int32_t time) override;
59 void on_movement_step() override;
60 void on_movement_end() override;
61
62 void on_status_effect_start(std::shared_ptr<status_change_entry> sce) override;
63 void on_status_effect_end(std::shared_ptr<status_change_entry> sce) override;
64 void on_status_effect_change(std::shared_ptr<status_change_entry> sce) override;
65};
66}
67}
68}
69
70#endif /* HORIZON_ZONE_GAME_ENTITIES_NPC_HPP */
directions
Definition: UnitDefinitions.hpp:75
Definition: GridObject.hpp:42
Definition: Unit.hpp:102
uint16_t job_id() const
Definition: Unit.hpp:146
std::shared_ptr< Map > map()
Map & Map Container.
Definition: Unit.hpp:165
const std::string & name() const
Definition: Unit.hpp:152
Definition: NPC.hpp:46
bool initialize()
Definition: NPC.cpp:60
void stop_movement() override
Definition: NPC.cpp:73
NPC(std::string const &name, std::shared_ptr< Map > map, uint16_t x, uint16_t y, uint32_t job_id, directions dir, std::shared_ptr< NPC > duplicate)
void on_status_effect_end(std::shared_ptr< status_change_entry > sce) override
Definition: NPC.cpp:99
~NPC()
Definition: NPC.cpp:54
void on_movement_end() override
Definition: NPC.cpp:93
NPC(std::string const &name, std::shared_ptr< Map > map, uint16_t x, uint16_t y, uint32_t job_id, directions dir, std::string const &script_file)
NPC(std::string const &name, std::shared_ptr< Map > map, uint16_t x, uint16_t y, uint32_t job_id, directions dir)
Definition: NPC.cpp:38
void on_status_effect_change(std::shared_ptr< status_change_entry > sce) override
Definition: NPC.cpp:100
void on_movement_step() override
Definition: NPC.cpp:88
void on_status_effect_start(std::shared_ptr< status_change_entry > sce) override
Definition: NPC.cpp:98
void on_pathfinding_failure() override
Definition: NPC.cpp:78
void on_movement_begin(int32_t time) override
Definition: NPC.cpp:83
Definition: Element.hpp:7