diff --git a/entities/spell_data/PlayerLocalSpellData.cpp b/entities/spell_data/PlayerLocalSpellData.cpp deleted file mode 100644 index 6d93292..0000000 --- a/entities/spell_data/PlayerLocalSpellData.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "PlayerLocalSpellData.h" -namespace BS { - namespace Player { - - } -} diff --git a/entities/spell_data/PlayerLocalSpellData.h b/entities/spell_data/PlayerLocalSpellData.h deleted file mode 100644 index 65b4e20..0000000 --- a/entities/spell_data/PlayerLocalSpellData.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include - -using namespace System; -namespace BS { - namespace Player { - class PlayerLocalSpellData : public virtual Object - { - }; - } -} diff --git a/entities/spell_data/PlayerLocalTargetNextPrevSpellData.cpp b/entities/spell_data/PlayerLocalTargetNextPrevSpellData.cpp deleted file mode 100644 index 09bcc0a..0000000 --- a/entities/spell_data/PlayerLocalTargetNextPrevSpellData.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "PlayerLocalTargetNextPrevSpellData.h" -namespace BS { - namespace Player { - PlayerLocalTargetNextPrevSpellData::PlayerLocalTargetNextPrevSpellData(WorldEntity* owner){ - LAYER = 2048; - rch = new Array(100); - direction = new Vector3((float)0, (float)1, (float)0); - enemyTargets = new List_T(); - this->owner = owner; - this->tc = owner->GetComponent(); - } - void PlayerLocalTargetNextPrevSpellData::Refresh() - { - WorldEntity* cTarget = this->tc->CTarget; - this->enemyTargetindex = 0; - this->enemyTargets->Clear(); - int num = Physics::SphereCastNonAlloc(this->owner->transform->position, (float)20, this->direction, this->rch, (float)0, this->LAYER); - for (int i = 0; i < num; i += 1) { - RaycastHit* raycastHit = this->rch->GetData(i); - WorldEntity* component = raycastHit->collider->gameObject->GetComponent(); - if (!*component == this->owner) { - if (*component == *cTarget) { - this->enemyTargetindex = i; - } - this->enemyTargets->Add(component); - } - } - } - void PlayerLocalTargetNextPrevSpellData::TargetNextEnemy() - { - if (this->enemyTargets->Count == 0) { - return; - } - this->enemyTargetindex += 1; - if (this->enemyTargetindex >= this->enemyTargets->Count) { - this->enemyTargetindex = 0; - } - this->tc->SetTarget(this->enemyTargets->GetData(this->enemyTargetindex)); - } - void PlayerLocalTargetNextPrevSpellData::TargetPreviousEnemy() - { - if (this->enemyTargets->Count == 0) { - return; - } - this->enemyTargetindex -= 1; - if (this->enemyTargetindex < 0) { - this->enemyTargetindex = this->enemyTargets->Count - 1; - } - this->tc->SetTarget(this->enemyTargets->GetData(this->enemyTargetindex)); - } - - } -} diff --git a/entities/spell_data/PlayerLocalTargetNextPrevSpellData.h b/entities/spell_data/PlayerLocalTargetNextPrevSpellData.h deleted file mode 100644 index cdfc6ec..0000000 --- a/entities/spell_data/PlayerLocalTargetNextPrevSpellData.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once -#include -#include "PlayerLocalSpellData.h" -#include "WorldEntity.h" -#include -#include "TargetComponent.h" -#include "Vector3.h" -#include "RaycastHit.h" -#include "Physics.h" - -using namespace System::Collections::Generic; -using namespace UnityEngine; -using namespace System; -namespace BS { - namespace Player { - class PlayerLocalTargetNextPrevSpellData : public virtual PlayerLocalSpellData, public virtual Object - { - private: - List_T* enemyTargets; - private: - int enemyTargetindex; - private: - WorldEntity* owner; - private: - TargetComponent* tc; - private: - Vector3* direction; - private: - Array* rch; - private: - int LAYER; - public: - PlayerLocalTargetNextPrevSpellData(WorldEntity* owner); - public: - void Refresh(); - public: - void TargetNextEnemy(); - public: - void TargetPreviousEnemy(); - }; - } -} diff --git a/entities/spell_data/PlayerSpellCooldownData.cpp b/entities/spell_data/PlayerSpellCooldownData.cpp deleted file mode 100644 index 887dcd2..0000000 --- a/entities/spell_data/PlayerSpellCooldownData.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "PlayerSpellCooldownData.h" -float PlayerSpellCooldownData::getCooldown(){ - return this->cooldown; -} -void PlayerSpellCooldownData::setCooldown(float value) -{ - this->cooldown = value; -} -float PlayerSpellCooldownData::getRemainingCooldown() -{ - return this->remainingCooldown; -} -void PlayerSpellCooldownData::setRemainingCooldown(float value) -{ - this->remainingCooldown = value; -} -PlayerSpellCooldownData::PlayerSpellCooldownData() -{ -} -PlayerSpellCooldownData::PlayerSpellCooldownData(int spellId, float cooldown, float remainingCooldown) : PlayerSpellData(spellId) -{ - this->setCooldown(cooldown); - this->setRemainingCooldown(remainingCooldown); -} -void PlayerSpellCooldownData::Update(PlayerSpellDataComponent* psdc) -{ - this->remainingCooldown -= Time::deltaTime; - if (this->remainingCooldown <= (float)0) { - psdc->RemoveSSpellData(this); - } -} -void PlayerSpellCooldownData::Serialize(JsonWriter* w) -{ - PlayerSpellCooldownData::ToJSON(this, w); -} -void PlayerSpellCooldownData::ToJSON(PlayerSpellCooldownData* psdc, JsonWriter* w) -{ - w->WritePropertyName(new String("PlayerSpellData")); - w->WriteStartObject(); - w->WritePropertyName(new String("Cooldown")); - w->WriteValue(psdc->getCooldown()); - w->WritePropertyName(new String("RemainingCooldown")); - w->WriteValue(psdc->getRemainingCooldown()); - w->WriteEndObject(); -} -void PlayerSpellCooldownData::FromJSON(PlayerSpellCooldownData* psdc, JsonReader* r) -{ - while (r->Read()) { - if (r->TokenType == JsonToken::PropertyName) { - String* a = (String*)(r->Value); - if (!*a == *(new String("Cooldown"))) { - if (*a == *(new String("RemainingCooldown"))) { - psdc->setRemainingCooldown((float)(r->ReadAsDouble()->Value)); - } - } - else { - psdc->setCooldown((float)(r->ReadAsDouble()->Value)); - } - } - else { - if (r->TokenType == JsonToken::EndObject) { - break; - } - } - } -} - diff --git a/entities/spell_data/PlayerSpellCooldownData.h b/entities/spell_data/PlayerSpellCooldownData.h deleted file mode 100644 index e880090..0000000 --- a/entities/spell_data/PlayerSpellCooldownData.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#include -#include "PlayerSpellData.h" -#include "PlayerSpellDataComponent.h" -#include "Time.h" -#include "JsonWriter.h" -#include "JsonReader.h" -#include "JsonToken.h" - -using namespace UnityEngine; -using namespace Newtonsoft::Json; -using namespace System; -//Forward Declaration -class PlayerSpellData; - -class PlayerSpellCooldownData : public virtual PlayerSpellData, public virtual Object{ - private: - float cooldown; - private: - float remainingCooldown; - public: - float getCooldown(); - public: - void setCooldown(float value); - public: - float getRemainingCooldown(); - public: - void setRemainingCooldown(float value); - public: - PlayerSpellCooldownData(); - public: - PlayerSpellCooldownData(int spellId, float cooldown, float remainingCooldown); - public: - virtual void Update(PlayerSpellDataComponent* psdc); - public: - virtual void Serialize(JsonWriter* w); - public: - static void ToJSON(PlayerSpellCooldownData* psdc, JsonWriter* w); - public: - static void FromJSON(PlayerSpellCooldownData* psdc, JsonReader* r); -}; diff --git a/entities/spell_data/PlayerSpellData.cs b/entities/spell_data/PlayerSpellData.cs deleted file mode 100644 index a36327e..0000000 --- a/entities/spell_data/PlayerSpellData.cs +++ /dev/null @@ -1,60 +0,0 @@ - -using Newtonsoft.Json; -using UnityEngine; -/// -/// Base SpellData class. -/// -[System.Serializable] -public class PlayerSpellData { - [SerializeField] - int spellId; - - public int SpellId { get { return spellId; } set { spellId = value; } } - - public PlayerSpellData() {} - - public PlayerSpellData(int spellId) - { - this.spellId = spellId; - } - - public virtual void Update(PlayerSpellDataComponent psdc) - { - } - - public virtual void Serialize(JsonWriter w) - { - ToJSON(this, w); - } - - public static void ToJSON(PlayerSpellData psdc, JsonWriter w) - { - w.WritePropertyName("PlayerSpellData"); - w.WriteStartObject(); - - w.WritePropertyName("SpellId"); - w.WriteValue(psdc.spellId); - - w.WriteEndObject(); - } - - public static void FromJSON(PlayerSpellData psdc, JsonReader r) - { - while (r.Read()) - { - if (r.TokenType == JsonToken.PropertyName) - { - switch ((string)r.Value) - { - case "SpellId": - psdc.spellId = (int)r.ReadAsInt32(); - break; - } - } - else if (r.TokenType == JsonToken.EndObject) - { - break; - } - } - } -}