entity_spell_system/Queued/ASDef_SpellSystem/SpellScriptFactory.cpp
2019-04-20 14:02:55 +02:00

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));
}
}
}
}