Пример #1
0
    // Writer
    public static void JsonSerializer(Jboy.JsonWriter writer, object instance)
    {
        writer.WriteArrayStart();

        var tree = (ArtifactTree)instance;

        foreach (var slotLevel in tree.slots)
        {
            writer.WriteArrayStart();

            for (int i = 0; i < slotLevel.Length; i++)
            {
                Jboy.Json.WriteObject(slotLevel[i].artifact, writer);
            }

            writer.WriteArrayEnd();
        }

        writer.WriteArrayEnd();
    }
Пример #2
0
    // Writer
    public static void JsonSerializer(Jboy.JsonWriter writer, object instance)
    {
        var inv = (T)instance;

        writer.WriteArrayStart();
        for (var i = 0; i < inv.bags.Length; i++)
        {
            GenericSerializer.WriteJSONClassInstance <Bag>(writer, inv.bags[i]);
        }
        writer.WriteArrayEnd();
    }