Exemple #1
0
 public void AddCarPartCollection(AaronCarPartCollection collection)
 {
     if (_carPartCollections.Contains(collection))
     {
         throw new ArgumentException("Attempted to add a duplicate car part collection");
     }
     _carPartCollections.Add(collection);
 }
Exemple #2
0
        private void ProcessCarHashList(Chunk chunk)
        {
            if (chunk.Size % 4 != 0)
            {
                throw new InvalidDataException("malformed car hash list chunk");
            }

            Progress?.Report("Processing car part collection hash list");

            while (Stream.Position < chunk.EndOffset)
            {
                AaronCarPartCollection carPartCollection = new AaronCarPartCollection();
                carPartCollection.Name  = HashResolver.Resolve(Reader.ReadUInt32());
                carPartCollection.Parts = new SynchronizedObservableCollection <AaronCarPartRecord>();

                this._carPartService.AddCarPartCollection(carPartCollection);
            }
        }
Exemple #3
0
        public AaronCarPartCollection ReplaceCarPartCollection(uint hash, AaronCarPartCollection collection)
        {
            var index = _carPartCollections.IndexOf(GetCarPartCollectionByHash(hash));

            return(_carPartCollections[index] = collection);
        }