public MercenaryItemSection(byte[] data, int offset)
        {
            if (data.Length - offset < MercenaryMinimumLength)
            {
                throw new Exception("Invalid mercenary data");
            }

            if (data[offset + 2] != HeaderMarkerk || data[offset + 3] != HeaderMarkerf)
            {
                // mercenary has items equipped
                m_items = new ItemListSection(data, offset + 2);
            }
        }
Пример #2
0
        public MercenaryItemSection(ReadOnlySpan <byte> data)
        {
            if (data.Length < MercenaryMinimumLength)
            {
                throw new Diablo2FileFormatException(FileValidity.InvalidMercenaryItemList);
            }

            if (data[2] != HeaderMarkerk || data[3] != HeaderMarkerf)
            {
                // mercenary has items equipped
                m_items = new ItemListSection(data.Slice(2));
            }
        }