bad-piggies-0.1.3-porting/Assets/Plugins/Assembly-CSharp-firstpass/MiniJsonExtensions.cs

26 lines
536 B
C#
Raw Normal View History

2024-02-24 22:40:44 -05:00
using System.Collections;
using System.Collections.Generic;
public static class MiniJsonExtensions
{
public static string toJson(this Hashtable obj)
{
return MiniJSON.jsonEncode(obj);
}
public static string toJson(this Dictionary<string, string> obj)
{
return MiniJSON.jsonEncode(obj);
}
public static ArrayList arrayListFromJson(this string json)
{
return MiniJSON.jsonDecode(json) as ArrayList;
}
public static Hashtable hashtableFromJson(this string json)
{
return MiniJSON.jsonDecode(json) as Hashtable;
}
}