Files
CreatureLib/src/Battling/EventHooks/Events/SwitchEvent.hpp
Deukhoofd de8b5de7b4
All checks were successful
continuous-integration/drone/push Build is passing
Mark several classes as final for devirtualization performance benefits.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-10-15 18:21:50 +02:00

21 lines
786 B
C++

#ifndef CREATURELIB_SWITCHEVENT_HPP
#define CREATURELIB_SWITCHEVENT_HPP
#include "../../Models/CreatureIndex.hpp"
#include "EventData.hpp"
namespace CreatureLib::Battling {
class SwitchEvent final : public EventData {
CreatureIndex _index;
ArbUt::BorrowedPtr<Creature> _newCreature;
public:
SwitchEvent(const CreatureIndex& index, const ArbUt::BorrowedPtr<Creature>& newCreature)
: _index(index), _newCreature(newCreature) {}
EventDataKind GetKind() const noexcept override { return EventDataKind ::Switch; }
const CreatureIndex& GetIndex() const noexcept { return _index; }
const ArbUt::BorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
};
}
#endif // CREATURELIB_SWITCHEVENT_HPP