1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Return the populated item when calling GetChildren to write more elegant code.

This commit is contained in:
Dean Herbert 2016-10-21 17:02:00 +09:00 committed by Drew DeVault
parent 6f80efdb29
commit 0c9e26e546

View File

@ -139,9 +139,12 @@ namespace osu.Game.Database
return connection.GetAllWithChildren<T>(filter, recursive);
}
public void GetChildren<T>(T item, bool recursive = true)
public T GetChildren<T>(T item, bool recursive = true)
{
connection.GetChildren<T>(item, recursive);
if (item == null) return default(T);
connection.GetChildren(item, recursive);
return item;
}
readonly Type[] validTypes = new[]