TheBoxyBear / charttools

Library for editing Clone Hero song files in .NET
https://theboxybear.github.io/charttools
GNU General Public License v3.0
13 stars 5 forks source link

Switch from duplicate checks on collection update to on IO (except for notes) #9

Closed TheBoxyBear closed 3 years ago

TheBoxyBear commented 3 years ago

Replace UniqueList, UniqueListEquatable and UniqueTrackObjectCollection with List<>. This would allow track objects to have their position changed without creating new instances and heavily improve performance on collection edits.

To check for duplicates when reading and writing files, I added the DuplicateTrackObjectPolicy property to ReadingConfiguration and WritingConfiguration. If the policy if set to IncludeAll, no duplicate checks are made. Otherwise, only include the first object or throw an exception depending on the policy.

As for the exception type, it would just be Exception for now until I can think of something better (potentially a custom exception?)

Once done, apply ObsoleteAttribute to UniqueList, UniqueListEquatable and UniqueTrackObjectCollection