예제 #1
0
파일: Patcher.cs 프로젝트: jet082/mm-rando
        /// <summary>
        /// Create <see cref="Patcher"/> from ALV data.
        /// </summary>
        /// <param name="rawBytes">ALV raw bytes</param>
        /// <returns><see cref="Patcher"/>.</returns>
        public static Patcher FromAlv(byte[] rawBytes)
        {
            var list      = new List <AlvReader.Entry>();
            var alvReader = new AlvReader(rawBytes);

            foreach (var entry in alvReader)
            {
                if (IsAddressRelevant(entry.Address))
                {
                    list.Add(entry);
                }
            }
            var patcher = new Patcher();

            patcher._data = list.ToArray();
            return(patcher);
        }
예제 #2
0
 public Enumerator(AlvReader reader) => _reader = reader;