mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:47:26 +08:00
6db3c32dd1
This may not be the cleanest solution, but there don't seem to be any way towards this either. - `UseDestinationValue` has been inherited by default as noted in https://docs.automapper.org/en/stable/10.0-Upgrade-Guide.html#usedestinationvalue-is-now-inherited-by-default, and its behaviour in this case would be using the nested **managed** realm object for the destination member rather than creating an unmanaged version. - `MaxDepth` already sets `PreserveReferences` so there's no point of using it. - `MaxDepth` should probably not be set for all maps, only for those with cyclic references, to avoid the expensive overhead of `PreserveReferences`, as mentioned in https://docs.automapper.org/en/stable/5.0-Upgrade-Guide.html#circular-references. That aside, `MaxDepth` should actually only be set to `1` for `BeatmapSetInfo` mapping, because we don't want AutoMapper to create a nested instance of `BeatmapSetInfo` in each mapped/detached beatmap, but for some reason, doing that will cause automapper to not map any beatmap inside the set and leave it with 0 beatmaps. While on the other hand, using `MaxDepth(2)` for `BeatmapSetInfo` works, but creates an unused instance of a `BeatmapSetInfo` inside each mapped beatmap, which may not be ideal. For `BeatmapInfo`, it has to be `MaxDepth(2)`, in which the first `BeatmapInfo` depth would be itself (when detaching a beatmap), and the second would be nested beatmaps inside the mapped/detached `BeatmapSetInfo` within the beatmap. (note that when detaching a beatmap set, the unused instance of `BeatmapSetInfo` within each beatmap of that beatmap set doesn't also have a list of unused beatmaps as one might expect from the depth specification, it surprisingly has 0 beatmaps) This causes it to create an unused instance of `BeatmapInfo` in the beatmap set resembling the root mapped/detached beatmap, but that one might be inevitable. |
||
---|---|---|
.. | ||
Audio | ||
Beatmaps | ||
Collections | ||
Configuration | ||
Database | ||
Extensions | ||
Graphics | ||
Input | ||
IO | ||
IPC | ||
Localisation | ||
Migrations | ||
Models | ||
Online | ||
Overlays | ||
Performance | ||
Properties | ||
Replays | ||
Rulesets | ||
Scoring | ||
Screens | ||
Skinning | ||
Stores | ||
Storyboards | ||
Tests | ||
Updater | ||
Users | ||
Utils | ||
.editorconfig | ||
osu!.res | ||
osu.Game.csproj | ||
OsuGame.cs | ||
OsuGameBase_Importing.cs | ||
OsuGameBase.cs | ||
PerformFromMenuRunner.cs |