Skip to content

Commit

Permalink
grouped overloads together
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Oct 27, 2023
1 parent 1bdff33 commit 4417451
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/DataModel/GameConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ public static IEnumerable<T> GetObjectsOf<T>(this GameConfiguration gameConfigur
return Enumerable.Empty<T>();
}

/// <summary>
/// Gets the objects of the specified type.
/// </summary>
/// <param name="gameConfiguration">The game configuration.</param>
/// <param name="type">The type of the wanted objects.</param>
/// <returns>The objects of the specified type.</returns>
public static IEnumerable<object> GetObjectsOf(this GameConfiguration gameConfiguration, Type type)
{
if (Enumerables.TryGetValue(type, out var enumerableGetter))
{
return enumerableGetter(gameConfiguration).OfType<object>();
}

return Enumerable.Empty<object>();
}

/// <summary>
/// Gets the instance of <paramref name="other"/> which is referenced within
/// the <paramref name="gameConfiguration"/> based on their equality.
Expand All @@ -140,22 +156,6 @@ public static IEnumerable<T> GetObjectsOf<T>(this GameConfiguration gameConfigur
return result;
}

/// <summary>
/// Gets the objects of the specified type.
/// </summary>
/// <param name="gameConfiguration">The game configuration.</param>
/// <param name="type">The type of the wanted objects.</param>
/// <returns>The objects of the specified type.</returns>
public static IEnumerable<object> GetObjectsOf(this GameConfiguration gameConfiguration, Type type)
{
if (Enumerables.TryGetValue(type, out var enumerableGetter))
{
return enumerableGetter(gameConfiguration).OfType<object>();
}

return Enumerable.Empty<object>();
}

/// <summary>
/// Gets the instance of <paramref name="other" /> which is referenced within
/// the <paramref name="gameConfiguration" /> based on their equality.
Expand Down

0 comments on commit 4417451

Please sign in to comment.