Adds C Interface for Item choice
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,7 +10,7 @@ namespace CreatureLib::Battling {
|
||||
std::optional<CreatureIndex> _target;
|
||||
|
||||
public:
|
||||
ItemTurnChoice(ArbUt::BorrowedPtr<Creature> user, const ArbUt::BorrowedPtr<Library::Item>& item,
|
||||
ItemTurnChoice(ArbUt::BorrowedPtr<Creature> user, const ArbUt::BorrowedPtr<const Library::Item>& item,
|
||||
const std::optional<CreatureIndex>& target)
|
||||
: BaseTurnChoice(user), _item(item), _target(target) {}
|
||||
~ItemTurnChoice() override = default;
|
||||
@@ -19,6 +19,14 @@ namespace CreatureLib::Battling {
|
||||
|
||||
[[nodiscard]] const ArbUt::BorrowedPtr<const Library::Item>& GetItem() const noexcept { return _item; }
|
||||
[[nodiscard]] const std::optional<CreatureIndex>& GetTarget() const noexcept { return _target; }
|
||||
|
||||
protected:
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override {
|
||||
GetOwnScripts(scripts);
|
||||
GetUser()->GetActiveScripts(scripts);
|
||||
}
|
||||
void GetOwnScripts(ArbUt::List<ScriptWrapper>&) override {}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user