From 44070461e78fc1531cb3b7ad2d8909e0fe7c4b7f Mon Sep 17 00:00:00 2001
From: Relintai <relintai@protonmail.com>
Date: Wed, 31 May 2023 22:49:36 +0200
Subject: [PATCH] Move the enums from the top of spell.h into the Spell class.

---
 .../entity_spell_system/data/spells/spell.cpp | 14 ++---
 .../entity_spell_system/data/spells/spell.h   | 53 +++++++++----------
 2 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/modules/entity_spell_system/data/spells/spell.cpp b/modules/entity_spell_system/data/spells/spell.cpp
index 3420cd026..e73258b4e 100644
--- a/modules/entity_spell_system/data/spells/spell.cpp
+++ b/modules/entity_spell_system/data/spells/spell.cpp
@@ -74,14 +74,14 @@ void Spell::set_cooldown(const float value) {
 	_cooldown = value;
 }
 
-SpellTargetType Spell::get_target_type() const {
+Spell::SpellTargetType Spell::get_target_type() const {
 	return _target_type;
 }
 void Spell::set_target_type(const SpellTargetType value) {
 	_target_type = value;
 }
 
-TargetRelationType Spell::get_target_relation_type() const {
+Spell::TargetRelationType Spell::get_target_relation_type() const {
 	return _target_relation_type;
 }
 void Spell::set_target_relation_type(const TargetRelationType value) {
@@ -472,7 +472,7 @@ void Spell::set_is_aoe(const bool value) {
 	_is_aoe = value;
 }
 
-SpellAOETargetType Spell::get_aoe_target_type() const {
+Spell::SpellAOETargetType Spell::get_aoe_target_type() const {
 	return _aoe_targetType;
 }
 void Spell::set_aoe_target_type(const SpellAOETargetType value) {
@@ -2454,10 +2454,10 @@ void Spell::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("notification_ccast", "what", "info"), &Spell::notification_ccast);
 
 	//Aura EventHandlers
-	BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
-	BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
-	BIND_VMETHOD(MethodInfo("_notification_aura_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
-	BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
+	BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData")));
+	BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo")));
+	BIND_VMETHOD(MethodInfo("_notification_aura_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
+	BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo")));
 
 	ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &Spell::notification_saura);
 	ClassDB::bind_method(D_METHOD("notification_sheal", "what", "aura", "info"), &Spell::notification_sheal);
diff --git a/modules/entity_spell_system/data/spells/spell.h b/modules/entity_spell_system/data/spells/spell.h
index 75ffae060..d5b539c2a 100644
--- a/modules/entity_spell_system/data/spells/spell.h
+++ b/modules/entity_spell_system/data/spells/spell.h
@@ -47,36 +47,31 @@ class AuraGroup;
 class AuraApplyInfo;
 class EntityResource;
 
-enum TargetRelationType {
-	TARGET_SELF = 1 << 0,
-	TARGET_ENEMY = 1 << 1,
-	TARGET_FRIENDLY = 1 << 2
-};
-
-VARIANT_ENUM_CAST(TargetRelationType);
-
-enum SpellTargetType {
-	SPELL_TARGET_TYPE_SELF,
-	SPELL_TARGET_TYPE_TARGET,
-	SPELL_TARGET_TYPE_AROUND,
-	SPELL_TARGET_TYPE_FRONT,
-	SPELL_TARGET_TYPE_AROUND_TARGET
-};
-
-VARIANT_ENUM_CAST(SpellTargetType);
-
-enum SpellAOETargetType {
-	SPELL_AOE_TARGET_TYPE_CASTER,
-	SPELL_AOE_TARGET_TYPE_TARGET,
-	SPELL_AOE_TARGET_TYPE_GOUND_TARGET_SELECTION,
-	SPELL_AOE_TARGET_TYPE_RANDOM
-};
-
-VARIANT_ENUM_CAST(SpellAOETargetType);
-
 class Spell : public Resource {
 	GDCLASS(Spell, Resource);
 
+public:
+	enum TargetRelationType {
+		TARGET_SELF = 1 << 0,
+		TARGET_ENEMY = 1 << 1,
+		TARGET_FRIENDLY = 1 << 2
+	};
+
+	enum SpellTargetType {
+		SPELL_TARGET_TYPE_SELF,
+		SPELL_TARGET_TYPE_TARGET,
+		SPELL_TARGET_TYPE_AROUND,
+		SPELL_TARGET_TYPE_FRONT,
+		SPELL_TARGET_TYPE_AROUND_TARGET
+	};
+
+	enum SpellAOETargetType {
+		SPELL_AOE_TARGET_TYPE_CASTER,
+		SPELL_AOE_TARGET_TYPE_TARGET,
+		SPELL_AOE_TARGET_TYPE_GOUND_TARGET_SELECTION,
+		SPELL_AOE_TARGET_TYPE_RANDOM
+	};
+
 public:
 	int get_id() const;
 	void set_id(const int value);
@@ -825,4 +820,8 @@ private:
 	Ref<Spell> _aura_talent_required_spell;
 };
 
+VARIANT_ENUM_CAST(Spell::TargetRelationType);
+VARIANT_ENUM_CAST(Spell::SpellTargetType);
+VARIANT_ENUM_CAST(Spell::SpellAOETargetType);
+
 #endif