mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
27 lines
727 B
C++
27 lines
727 B
C++
#include "SpellScriptFactory.h"
|
|
namespace BS {
|
|
namespace SpellsNS {
|
|
namespace Utils {
|
|
void SpellScriptFactory::GetScript(String* name, GameObject* g){
|
|
Debug::Log(*(new String("Spellscript not found! name: ")) + *name);
|
|
}
|
|
String* SpellScriptFactory::GetScriptString(GameObject* g)
|
|
{
|
|
return g->GetComponent<SpellScript>()->GetType()->Name;
|
|
}
|
|
void SpellScriptFactory::FromJSON(GameObject* g, JsonReader* r)
|
|
{
|
|
if (r->Read()) {
|
|
SpellScriptFactory::GetScript((String*)(r->Value), g);
|
|
}
|
|
}
|
|
void SpellScriptFactory::ToJSON(GameObject* g, JsonWriter* w)
|
|
{
|
|
w->WritePropertyName(new String("SpellScript"));
|
|
w->WriteValue(SpellScriptFactory::GetScriptString(g));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|