Ejemplo n.º 1
0
        public static void Read(this IDictionary <string, float> _this, EndianStream stream)
        {
            int count = stream.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string key   = stream.ReadStringAligned();
                float  value = stream.ReadSingle();
                _this.Add(key, value);
            }
        }
Ejemplo n.º 2
0
        public static void Read <T>(this IDictionary <T, float> _this, EndianStream stream, Func <T> instantiator)
            where T : IStreamReadable
        {
            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);
            }
        }