mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
28 lines
740 B
C++
28 lines
740 B
C++
#include "loot_data_base.h"
|
|
|
|
float LootDataBase::get_chance() const {
|
|
return _chance;
|
|
}
|
|
void LootDataBase::set_chance(const float value) {
|
|
_chance = value;
|
|
}
|
|
|
|
void LootDataBase::get_loot(Array into) {
|
|
if (has_method("_get_loot"))
|
|
call("_get_loot", into);
|
|
}
|
|
|
|
LootDataBase::LootDataBase() {
|
|
_chance = 100;
|
|
}
|
|
|
|
void LootDataBase::_bind_methods() {
|
|
BIND_VMETHOD(MethodInfo("_get_loot", PropertyInfo(Variant::ARRAY, "into")));
|
|
|
|
ClassDB::bind_method(D_METHOD("get_loot"), &LootDataBase::get_loot);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_chance"), &LootDataBase::get_chance);
|
|
ClassDB::bind_method(D_METHOD("set_chance", "value"), &LootDataBase::set_chance);
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "chance"), "set_chance", "get_chance");
|
|
}
|