mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 00:23:01 +08:00
Return the populated item when calling GetChildren to write more elegant code.
This commit is contained in:
parent
6f80efdb29
commit
0c9e26e546
@ -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[]
|
||||
|
Loading…
Reference in New Issue
Block a user