Commit 53dc2b04 authored by louiz’'s avatar louiz’

Pass a World pointer to Ability::cast

parent ef575b41
......@@ -25,8 +25,8 @@ public:
Ability() = default;
virtual ~Ability() = default;
virtual void tick(Entity*, World*) {}
virtual void cast(Entity*, const Position&, const bool) {}
virtual void cast(Entity*, Entity*, const bool) {}
virtual void cast(Entity*, World*, const Position&, const bool) {}
virtual void cast(Entity*, World*, Entity*, const bool) {}
virtual const std::string& get_name() const = 0;
virtual AbilityType get_type() const = 0;
......
......@@ -18,7 +18,7 @@ Attack::Attack(const std::size_t fs, const std::size_t bs):
{
}
void Attack::cast(Entity* entity, const Position& pos, const bool queue)
void Attack::cast(Entity* entity, World*, const Position& pos, const bool queue)
{
log_debug("Attacking with entity " << entity->get_id() << " until position " << pos);
auto work = std::make_unique<AttackWork>(entity, pos);
......@@ -28,6 +28,6 @@ void Attack::cast(Entity* entity, const Position& pos, const bool queue)
entity->set_work(std::move(work));
}
void Attack::cast(Entity* entity, Entity* target, const bool queue)
void Attack::cast(Entity* entity, World *, Entity* target, const bool queue)
{
}
......@@ -8,8 +8,8 @@ class Attack: public ActiveAbility<Attack>
public:
Attack(const std::size_t fs, const std::size_t bs);
~Attack() = default;
void cast(Entity* entity, const Position& pos, const bool queue) override final;
void cast(Entity* entity, Entity* target, const bool queue) override final;
void cast(Entity* entity, World *, const Position& pos, const bool queue) override final;
void cast(Entity* entity, World *, Entity* target, const bool queue) override final;
protected:
std::size_t frontswing_duration;
......
......@@ -17,7 +17,7 @@ Blink::Blink():
{
}
void Blink::cast(Entity* entity, const Position& position, const bool queue)
void Blink::cast(Entity* entity, World*, const Position& position, const bool queue)
{
// Check mana, cooldown etc etc
log_debug("CASTING blink for entity" << entity->get_id() << " to pos " << position);
......
......@@ -8,7 +8,7 @@ class Blink: public ActiveAbility<Blink>
public:
Blink();
~Blink() = default;
void cast(Entity* entity, const Position& pos, const bool queue) override final;
void cast(Entity* entity, World*, const Position& pos, const bool queue) override final;
private:
Blink(const Blink&) = delete;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment