Beispiel #1
0
 public BuffList(long address)
 {
     Address   = address;
     Count     = ReadInt32(Address - 0x08);
     FirstNode = new BuffData(ReadPointer8b(Address - 0x10));
     Start     = ReadPointer8b(Address);
     End       = ReadPointer8b(0x08);
 }
Beispiel #2
0
        private Dictionary <int, BuffData> GetActiveBuffs()
        {
            if (!Count.Equals(_oldCount))
            {
                _oldCount = Count;
                _buffer   = null;
            }
            else
            {
                return(_buffer);
            }

            Dictionary <int, BuffData> list = new Dictionary <int, BuffData>();

            var start   = Start;
            var end     = End;
            int maxSize = 500;

            BuffData curNode = FirstNode;

            for (int i = 0; i < maxSize; i++)
            {
                BuffData nextNode = curNode.x0000_NextActiveBuff;

                if (nextNode.x0000_PreviousActiveBuff.Address == curNode.Address)
                {
                    if (!list.ContainsKey(curNode.x0038_BuffTableData.x0000_Index) && curNode.Address != FirstNode.Address)
                    {
                        list.Add(curNode.x0038_BuffTableData.x0000_Index, curNode);
                    }

                    curNode = nextNode;
                }
                else
                {
                    break;
                }
            }

            if (_buffer == null)
            {
                _buffer = list;
            }

            return(list);
        }