Esempio n. 1
0
    private void RunRestore()
    {
        ClosureType type;

        while ((type = (ClosureType)this._br.ReadByte()) != ClosureType.END)
        {
            switch (type)
            {
            case ClosureType.Class:
            {
                ushort       index = this._br.ReadUInt16();
                GameTypeAttr attr  = this._typeArray[index];
                continue;
            }

            case ClosureType.Instance:
            {
                ushort       num2  = this._br.ReadUInt16();
                uint         num3  = this._br.ReadUInt32();
                GameTypeAttr attr2 = this._typeArray[num2];
                break;
            }
            }
        }
    }
Esempio n. 2
0
 public void InitGameType(Assembly[] asmbs)
 {
     this._typeCounter = 0;
     this._typeKeySeed = 0;
     this._typeArray   = new GameTypeAttr[0x65];
     for (int i = 0; i < asmbs.Length; i++)
     {
         Type[] types = asmbs[i].GetTypes();
         for (int j = 0; j < types.Length; j++)
         {
             MethodInfo[] methods = types[j].GetMethods(BindingFlags.Public | BindingFlags.Static);
             for (int k = 0; k < methods.Length; k++)
             {
                 object[] customAttributes = methods[k].GetCustomAttributes(typeof(GameTypeAttr), false);
                 if ((customAttributes != null) && (customAttributes.Length > 0))
                 {
                     GameTypeAttr attr = customAttributes[0] as GameTypeAttr;
                     if (attr.key >= this._typeArray.Length)
                     {
                         GameTypeAttr[] destinationArray = new GameTypeAttr[attr.key + 100];
                         Array.Copy(this._typeArray, destinationArray, this._typeArray.Length);
                         this._typeArray = destinationArray;
                     }
                     if (this._typeArray[attr.key] == null)
                     {
                         this._typeArray[attr.key] = attr;
                     }
                     if (attr.key > this._typeCounter)
                     {
                         this._typeCounter = attr.key;
                     }
                 }
             }
         }
     }
 }