Extract update into PreUpdate(), add test

This commit is contained in:
smoogipoo
2020-06-02 17:22:09 +09:00
parent fac96f6ddd
commit dfb9687fb5
3 changed files with 26 additions and 4 deletions

View File

@ -430,10 +430,20 @@ namespace osu.Game.Database
{
item.Hash = computeHash(item);
PreUpdate(item);
ModelStore.Update(item);
}
}
/// <summary>
/// Perform any final actions before the update to database executes.
/// </summary>
/// <param name="item">The <typeparamref name="TModel"/> that is being updated.</param>
protected virtual void PreUpdate(TModel item)
{
}
/// <summary>
/// Delete an item from the manager.
/// Is a no-op for already deleted items.