Пример #1
0
 /// <summary>
 /// Serializes an ErfKey array to the stream.
 /// </summary>
 /// <param name="s">The stream</param>
 /// <param name="keys">The array to serialize</param>
 public static void Serlialize(Stream s, ErfKeyVer10[] keys)
 {
     // Loop through the keys, assigning them a resource ID
     // (it's just the array index) and then serializing them.
     for (int i = 0; i < keys.Length; i++)
     {
         keys[i].resourceID = i;
         keys[i].Serialize(s);
     }
 }
Пример #2
0
        public ErfKey(string filename, double version)
        {
            this.version = version;

            if (version == 1.0)
                keyVer10 = new ErfKeyVer10(filename);
            else if (version == 1.1)
                keyVer11 = new ErfKeyVer11(filename);
        }
Пример #3
0
 /// <summary>
 /// Deserializes an array of ErfKey structures from the stream.
 /// </summary>
 /// <param name="s">The stream</param>
 /// <param name="count">The number of keys to deserialize</param>
 /// <returns>An array of ErfKey structures</returns>
 public static ErfKeyVer10[] Deserialize(Stream s, int count)
 {
     // Create an array of ErfKeys from the stream.
     ErfKeyVer10[] keys = new ErfKeyVer10[count];
     for (int i = 0; i < count; i++)
         keys[i] = new ErfKeyVer10(s);
     return keys;
 }
Пример #4
0
        public ErfKey(Stream s, double version)
        {
            this.version = version;

            if (version == 1.0)
                keyVer10 = new ErfKeyVer10(s);
            else if (version == 1.1)
                keyVer11 = new ErfKeyVer11(s);
        }