1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-03 02:37:28 +00:00

Remove unused custom type resolver.

This commit is contained in:
EliteMasterEric 2024-10-18 16:33:22 -04:00
parent 36d7de5692
commit 2383fdfade
2 changed files with 1 additions and 52 deletions

View file

@ -961,10 +961,7 @@ class Save
*/
static function loadFromSlot(slot:Int):Save
{
trace("[SAVE] Loading save from slot " + slot + "...");
// Prevent crashes if the save data is corrupted.
SerializerUtil.initSerializer();
trace('[SAVE] Loading save from slot $slot...');
FlxG.save.bind('$SAVE_NAME${slot}', SAVE_PATH);

View file

@ -63,31 +63,6 @@ class SerializerUtil
}
}
public static function initSerializer():Void
{
haxe.Unserializer.DEFAULT_RESOLVER = new FunkinTypeResolver();
}
/**
* Serialize a Haxe object using the built-in Serializer.
* @param input The object to serialize
* @return The serialized object as a string
*/
public static function fromHaxeObject(input:Dynamic):String
{
return haxe.Serializer.run(input);
}
/**
* Convert a serialized Haxe object back into a Haxe object.
* @param input The serialized object as a string
* @return The deserialized object
*/
public static function toHaxeObject(input:String):Dynamic
{
return haxe.Unserializer.run(input);
}
/**
* Customize how certain types are serialized when converting to JSON.
*/
@ -115,26 +90,3 @@ class SerializerUtil
return result;
}
}
class FunkinTypeResolver
{
public function new()
{
// Blank constructor.
}
public function resolveClass(name:String):Class<Dynamic>
{
if (name == 'Dynamic')
{
FlxG.log.warn('Found invalid class type in save data, indicates partial save corruption.');
return null;
}
return Type.resolveClass(name);
};
public function resolveEnum(name:String):Enum<Dynamic>
{
return Type.resolveEnum(name);
};
}