#include "weapon_data.hpp"
#include "utils/godot_macros.h"

namespace godot {
void WeaponData::_bind_methods() {
#define CLASSNAME WeaponData
    GDPROPERTY_HINTED(projectile_scene, Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "PackedScene");
    GDPROPERTY(damage, Variant::INT);
    GDPROPERTY(range, Variant::FLOAT);
    GDPROPERTY(projectile_count, Variant::INT);
    GDPROPERTY(rounds_per_second, Variant::FLOAT);
    GDPROPERTY(allow_automatic, Variant::BOOL);
    GDPROPERTY_HINTED(projectile_speed, Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Curve");
}

void WeaponData::set_projectile_scene(Ref<PackedScene> scene) {
    this->projectile_scene = scene;
}

Ref<PackedScene> WeaponData::get_projectile_scene() const {
    return this->projectile_scene;
}

void WeaponData::set_damage(int damage) {
    this->damage = damage;
}

int WeaponData::get_damage() const {
    return this->damage;
}

void WeaponData::set_range(float range) {
    this->range = range;
}

float WeaponData::get_range() const {
    return this->range;
}

void WeaponData::set_projectile_count(int projectile_count) {
    this->projectile_count = projectile_count;
}

int WeaponData::get_projectile_count() const {
    return this->projectile_count;
}

void WeaponData::set_rounds_per_second(float rps) {
    this->rounds_per_second = rps;
}

float WeaponData::get_rounds_per_second() const {
    return this->rounds_per_second;
}

void WeaponData::set_allow_automatic(bool allow) {
    this->allow_automatic = allow;
}

bool WeaponData::get_allow_automatic() const {
    return this->allow_automatic;
}

void WeaponData::set_projectile_speed(Ref<Curve> curve) {
    this->projectile_speed = curve;
}

Ref<Curve> WeaponData::get_projectile_speed() const {
    return this->projectile_speed;
}
}
