2017-09-27 04:31:41 -03:00
|
|
|
#ifndef _ACTIONCOLLISION_H
|
|
|
|
#define _ACTIONCOLLISION_H
|
|
|
|
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Common.h>
|
2018-06-02 15:52:35 +02:00
|
|
|
#include "Forwards.h"
|
2018-03-06 00:10:36 +01:00
|
|
|
|
2017-09-27 04:31:41 -03:00
|
|
|
namespace Core {
|
2018-08-29 21:40:59 +02:00
|
|
|
namespace Data {
|
|
|
|
struct Action;
|
2018-03-06 00:10:36 +01:00
|
|
|
}
|
2018-06-02 15:52:35 +02:00
|
|
|
|
2017-12-08 23:27:59 +01:00
|
|
|
namespace Entity {
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
enum class TargetFilter
|
|
|
|
{
|
|
|
|
All, // All actors in the AoE are applicable for collision
|
|
|
|
Players, // Only players
|
|
|
|
Allies, // Only allies (players, ally NPCs)
|
|
|
|
Party, // Only party members
|
|
|
|
Enemies // Only enemies
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCollision
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
static bool isActorApplicable( Actor& actor, TargetFilter targetFilter );
|
|
|
|
|
|
|
|
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition,
|
|
|
|
std::set< ActorPtr > actorsInRange,
|
|
|
|
boost::shared_ptr< Data::Action > actionInfo,
|
|
|
|
TargetFilter targetFilter );
|
|
|
|
|
|
|
|
private:
|
|
|
|
static bool radiusCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition,
|
|
|
|
uint16_t radius );
|
|
|
|
|
|
|
|
static bool boxCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition,
|
|
|
|
uint16_t width, uint16_t height );
|
|
|
|
|
|
|
|
};
|
2017-12-08 23:27:59 +01:00
|
|
|
|
|
|
|
}
|
2017-09-27 04:31:41 -03:00
|
|
|
}
|
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#endif
|