#ifndef FIGHT_PROP_H
#define FIGHT_PROP_H

#include "physics_entity.h"
#include "behaviour_entity.h"
#include "transformable.h"
#include "drop.h"
#include "transform.h"
#include "sprite.h"
#include "rigidbody.h"
#include "collider.h"
#include "typeclass_helpers.h"

typedef struct Prop {
    Transform transform;
    Sprite* sprite;
    RigidBody* rigidbody;
    Collider* collisionShape;
} Prop;

Prop* MakeProp(Sprite* sprite, Shape* shape);
Prop* SpawnProp(Vector location, Sprite* sprite, Shape* shape, Vector origin);
void DestroyProp(Prop* self);

void PropStart(Prop* self);
void PropUpdate(Prop* self, float deltaTime);
void PropDraw(Prop* self);

void PropOnCollision(Prop* self, Collision collision);
void PropOnOverlap(Prop* self, Collider* other);

Transform* PropGetTransform(Prop* self);
RigidBody* PropGetRigidBody(Prop* self);

static long PropGetDepth(Prop* self) { return -(int)(self->transform.position.y * 1000); }

DECL_REFLECT(Prop)

decl_typeclass_impl(Transformable, Prop)
decl_typeclass_impl(PhysicsEntity, Prop)
decl_typeclass_impl(Drop, Prop)
decl_typeclass_impl(BehaviourEntity, Prop)

#endif // !FIGHT_PROP_H
