File tree Expand file tree Collapse file tree 5 files changed +37
-0
lines changed Expand file tree Collapse file tree 5 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 11add_sources(libopenage
22 apply_effect.cpp
33 idle.cpp
4+ line_of_sight.cpp
45 live.cpp
56 move.cpp
67 resistance.cpp
Original file line number Diff line number Diff line change 1+ // Copyright 2024-2024 the openage authors. See copying.md for legal info.
2+
3+ #include " line_of_sight.h"
4+
5+
6+ namespace openage ::gamestate::component {
7+
8+ component_t LineOfSight::get_type () const {
9+ return component_t ::LINE_OF_SIGHT;
10+ }
11+
12+ } // namespace openage::gamestate::component
Original file line number Diff line number Diff line change 1+ // Copyright 2024-2024 the openage authors. See copying.md for legal info.
2+
3+ #pragma once
4+
5+ #include " gamestate/component/api_component.h"
6+ #include " gamestate/component/types.h"
7+
8+
9+ namespace openage ::gamestate::component {
10+
11+ class LineOfSight final : public APIComponent {
12+ public:
13+ using APIComponent::APIComponent;
14+
15+ component_t get_type () const override ;
16+ };
17+
18+ } // namespace openage::gamestate::component
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ enum class component_t {
2323 MOVE,
2424 SELECTABLE,
2525 LIVE,
26+ LINE_OF_SIGHT,
2627};
2728
2829} // namespace openage::gamestate::component
Original file line number Diff line number Diff line change 2525#include " gamestate/api/activity.h"
2626#include " gamestate/component/api/apply_effect.h"
2727#include " gamestate/component/api/idle.h"
28+ #include " gamestate/component/api/line_of_sight.h"
2829#include " gamestate/component/api/live.h"
2930#include " gamestate/component/api/move.h"
3031#include " gamestate/component/api/resistance.h"
@@ -221,6 +222,10 @@ void EntityFactory::init_components(const std::shared_ptr<openage::event::EventL
221222 auto resistance = std::make_shared<component::Resistance>(loop, ability_obj);
222223 entity->add_component (resistance);
223224 }
225+ else if (ability_parent == " engine.ability.type.LineOfSight" ) {
226+ auto line_of_sight = std::make_shared<component::LineOfSight>(loop, ability_obj);
227+ entity->add_component (line_of_sight);
228+ }
224229 else {
225230 log::log (DBG << " Entity has unrecognized ability type: " << ability_parent);
226231 }
You can’t perform that action at this time.
0 commit comments