Skip to content

Commit

Permalink
gamestate: Add missing definitions for already implemented abilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Sep 7, 2024
1 parent 5ea4b34 commit fe0e630
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
22 changes: 13 additions & 9 deletions libopenage/gamestate/api/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ namespace openage::gamestate::api {
* Maps internal ability types to nyan API values.
*/
static const auto ABILITY_DEFS = datastructure::create_const_map<ability_t, nyan::ValueHolder>(
std::pair(ability_t::ACTIVITY,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Activity"))),
std::pair(ability_t::APPLY_CONTINUOUS_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.ApplyContinuousEffect"))),
std::pair(ability_t::APPLY_DISCRETE_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.ApplyDiscreteEffect"))),
std::pair(ability_t::RANGED_CONTINUOUS_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.RangedContinuousEffect"))),
std::pair(ability_t::RANGED_DISCRETE_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.RangedDiscreteEffect"))),
std::pair(ability_t::RESISTANCE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Resistance"))),
std::pair(ability_t::IDLE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Idle"))),
std::pair(ability_t::MOVE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Move"))),
std::pair(ability_t::LINE_OF_SIGHT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.LineOfSight"))),
std::pair(ability_t::LIVE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Live"))),
std::pair(ability_t::RANGED_CONTINUOUS_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.RangedContinuousEffect"))),
std::pair(ability_t::RANGED_DISCRETE_EFFECT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.RangedDiscreteEffect"))),
std::pair(ability_t::RESISTANCE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Resistance"))),
std::pair(ability_t::SELECTABLE,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Selectable"))),
std::pair(ability_t::TURN,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Turn"))),
std::pair(ability_t::LINE_OF_SIGHT,
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.LineOfSight"))));
nyan::ValueHolder(std::make_shared<nyan::ObjectValue>("engine.ability.type.Turn"))));

/**
* Maps internal effect types to nyan API values.
Expand Down
10 changes: 6 additions & 4 deletions libopenage/gamestate/api/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ namespace openage::gamestate::api {
* Types of abilities for API objects.
*/
enum class ability_t {
ACTIVITY,
APPLY_CONTINUOUS_EFFECT,
APPLY_DISCRETE_EFFECT,
RANGED_CONTINUOUS_EFFECT,
RANGED_DISCRETE_EFFECT,
RESISTANCE,
IDLE,
LINE_OF_SIGHT,
LIVE,
MOVE,
RANGED_CONTINUOUS_EFFECT,
RANGED_DISCRETE_EFFECT,
RESISTANCE,
SELECTABLE,
TURN,
LINE_OF_SIGHT,

// TODO
};
Expand Down

0 comments on commit fe0e630

Please sign in to comment.