Initial work on item use handling
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:
25
src/Battling/TurnChoices/ItemTurnChoice.hpp
Normal file
25
src/Battling/TurnChoices/ItemTurnChoice.hpp
Normal 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
|
||||
Reference in New Issue
Block a user