Пример #1
0
        public void Read(VoidPtr userDataAddr)
        {
            if (userDataAddr == null)
            {
                return;
            }

            UserData *     data   = (UserData *)userDataAddr;
            ResourceGroup *group  = data->Group;
            ResourceEntry *pEntry = &group->_first + 1;
            int            count  = group->_numEntries;

            for (int i = 0; i < count; i++, pEntry++)
            {
                UserDataEntry *entry = (UserDataEntry *)((VoidPtr)group + pEntry->_dataOffset);
                UserDataClass  d     = new UserDataClass()
                {
                    _name = new string((sbyte *)group + pEntry->_stringOffset)
                };
                VoidPtr addr = (VoidPtr)entry + entry->_dataOffset;
                d._type = entry->Type;
                if (d._type != UserValueType.String)
                {
                    for (int x = 0; x < entry->_entryCount; x++)
                    {
                        switch (entry->Type)
                        {
                        case UserValueType.Float:
                            d._entries.Add(((float)*(bfloat *)addr).ToString());
                            addr += 4;
                            break;

                        case UserValueType.Int:
                            d._entries.Add(((int)*(bint *)addr).ToString());
                            addr += 4;
                            break;
                        }
                    }
                }
                else
                {
                    d._entries.Add(new string((sbyte *)addr));
                }

                Add(d);
            }
        }
Пример #2
0
 public void Remove(UserDataClass u)
 {
     this.List.Remove(u);
 }
Пример #3
0
 public void Add(UserDataClass u)
 {
     this.List.Add(u);
 }
Пример #4
0
 public void Remove(UserDataClass u)
 {
     this.List.Remove(u);
 }
Пример #5
0
 public void Read(VoidPtr userDataAddr)
 {
     if (userDataAddr == null) return;
     UserData* data = (UserData*)userDataAddr;
     ResourceGroup* group = data->Group;
     ResourceEntry* pEntry = &group->_first + 1;
     int count = group->_numEntries;
     for (int i = 0; i < count; i++)
     {
         UserDataEntry* entry = (UserDataEntry*)((VoidPtr)group + pEntry->_dataOffset);
         UserDataClass d = new UserDataClass() { _name = new String((sbyte*)group + pEntry->_stringOffset) };
         VoidPtr addr = (VoidPtr)entry + entry->_dataOffset;
         d._type = entry->Type;
         if (d._type != UserValueType.String)
             for (int x = 0; x < entry->_entryCount; x++)
                 switch (entry->Type)
                 {
                     case UserValueType.Float:
                         d._entries.Add(((float)*(bfloat*)addr).ToString());
                         addr += 4;
                         break;
                     case UserValueType.Int:
                         d._entries.Add(((int)*(bint*)addr).ToString());
                         addr += 4;
                         break;
                 }
         else
             d._entries.Add(new String((sbyte*)addr));
         Add(d);
     }
 }
Пример #6
0
 public void Add(UserDataClass u)
 {
     this.List.Add(u);
 }