public static Tuple <char, float>[] ReadTupleCharSingleArray(this AssetStream stream) { int count = stream.ReadInt32(); Tuple <char, float>[] array = new Tuple <char, float> [count]; for (int i = 0; i < count; i++) { Tuple <char, float> tuple = ReadTupleCharSingle(stream); array[i] = tuple; } return(array); }
public static void Read <T>(this IList <T> _this, AssetStream stream) where T : IAssetReadable, new() { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { T value = new T(); value.Read(stream); _this.Add(value); } }
public static void Read <T>(this IList <T> _this, AssetStream stream, Func <T> instantiator) where T : IAssetReadable { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { T value = instantiator(); value.Read(stream); _this.Add(value); } }
public static void Read <T>(this IDictionary <T, float> _this, AssetStream stream, Func <T> instantiator) where T : IAssetReadable { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { T key = instantiator(); key.Read(stream); float value = stream.ReadSingle(); _this.Add(key, value); } }
public static void Read <T>(this IDictionary <string, T> _this, AssetStream stream, Func <T> instantiator) where T : IAssetReadable { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { string key = stream.ReadStringAligned(); T value = instantiator(); value.Read(stream); _this.Add(key, value); } }
public static Tuple <string, T>[] ReadTupleStringTArray <T>(this AssetStream stream) where T : IAssetReadable, new() { int count = stream.ReadInt32(); Tuple <string, T>[] array = new Tuple <string, T> [count]; for (int i = 0; i < count; i++) { Tuple <string, T> tuple = ReadTupleStringT <T>(stream); array[i] = tuple; } return(array); }
public static void Read <T1, T2>(this Dictionary <Tuple <T1, long>, T2> _this, AssetStream stream) where T1 : IAssetReadable, new() where T2 : IAssetReadable, new() { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { Tuple <T1, long> key = stream.ReadTupleTLong <T1>(); T2 value = new T2(); value.Read(stream); _this.Add(key, value); } }
public static void Read <T1, T2>(this IDictionary <T1, T2> _this, AssetStream stream, Func <T1> keyInstantiator, Func <T2> valueInstantiator) where T1 : IAssetReadable where T2 : IAssetReadable { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { T1 key = keyInstantiator(); key.Read(stream); T2 value = valueInstantiator(); value.Read(stream); _this.Add(key, value); } }
public static void Read <T1, T2>(this IDictionary <T1, T2> _this, AssetStream stream) where T1 : IAssetReadable, new() where T2 : IAssetReadable, new() { int count = stream.ReadInt32(); for (int i = 0; i < count; i++) { T1 key = new T1(); key.Read(stream); T2 value = new T2(); value.Read(stream); _this.Add(key, value); } }
public static KeyValuePair <string, T>[] ReadStringKVPArray <T>(this AssetStream stream) where T : IAssetReadable, new() { int count = stream.ReadInt32(); KeyValuePair <string, T>[] array = new KeyValuePair <string, T> [count]; for (int i = 0; i < count; i++) { string key = stream.ReadStringAligned(); T value = new T(); value.Read(stream); KeyValuePair <string, T> kvp = new KeyValuePair <string, T>(key, value); array[i] = kvp; } return(array); }