Created
August 24, 2015 17:54
-
-
Save 0x0ade/93e917ff931a75300592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name String | |
Triles Object<Dictionary<int, Trile>> | |
TextureAtlas Object<Texture2D> | |
OnDeserialization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class JITType { | |
public static object Read(BinaryReader reader, bool xnb) { | |
TrileSet obj = new TrileSet(); | |
obj.Name = reader.ReadString(); | |
obj.Triles = FmbLib.ReadAsset<Dictionary<int, Trile>>(reader, xnb); | |
obj.TextureAtlas = FmbLib.ReadAsset<Texture2D>(reader, xnb); | |
obj.OnDeserialization(); | |
return obj; | |
} | |
public static void Write(BinaryWriter writer, object obj_) { | |
TrileSet obj = (TrileSet) obj_; | |
writer.Write(obj.Name); | |
FmbLib.WriteAsset(writer, obj.Triles); | |
FmbLib.WriteAsset(writer, obj.TextureAtlas); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment