Initial work on item use handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-02-13 13:40:33 +01:00
parent 173c6c9926
commit c40f063683
5 changed files with 60 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
#ifndef CREATURELIB_ITEMTURNCHOICE_HPP
#define CREATURELIB_ITEMTURNCHOICE_HPP
#include "../../Library/Items/Item.hpp"
#include "../Models/CreatureIndex.hpp"
#include "BaseTurnChoice.hpp"
namespace CreatureLib::Battling {
class ItemTurnChoice : public BaseTurnChoice {
ArbUt::BorrowedPtr<const Library::Item> _item;
std::optional<CreatureIndex> _target;
public:
ItemTurnChoice(ArbUt::BorrowedPtr<Creature> user, const ArbUt::BorrowedPtr<Library::Item>& item,
const std::optional<CreatureIndex>& target)
: BaseTurnChoice(user), _item(item), _target(target) {}
~ItemTurnChoice() override = default;
[[nodiscard]] TurnChoiceKind GetKind() const noexcept override { return TurnChoiceKind::Item; }
[[nodiscard]] const ArbUt::BorrowedPtr<const Library::Item>& GetItem() const noexcept { return _item; }
[[nodiscard]] const std::optional<CreatureIndex>& GetTarget() const noexcept { return _target; }
};
}
#endif // CREATURELIB_ITEMTURNCHOICE_HPP