karaoke-dev / karaoke

Will be the best karaoke system.
http://blog.karaoke.dev
GNU General Public License v3.0
207 stars 16 forks source link

Should throw the exception if object is referenced by another property in the change handler. #2058

Open andy840119 opened 1 year ago

andy840119 commented 1 year ago

If want to delete the singer:

  1. need to remove the singer id from the lyric first.
  2. remove the singer and remove all related ids from the lyric
  3. delete the singer, and clear the singer id at save the beatmap to the json.

If we select the behavior 1, need to make sure that should not delete the singer if singer is referenced by other lyric in the change handler.

Need to implement the #2056 first for able to find all reference object.

andy840119 commented 1 year ago

Note that we need to manually remove the singer id from the lyric. See the BeatmapSingersChangeHandler.Remove()

Maybe we can write the utils to remove the id from the object?