Exposed services as an IEnumerator instead

This commit is contained in:
Justas Dabrila
2016-02-12 17:19:30 +02:00
parent 0dbe3cf955
commit 6841217dad

View File

@@ -1,11 +1,11 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace Discord namespace Discord
{ {
public class ServiceManager public class ServiceManager
{ {
public IEnumerable<IService> Services => _services.Values;
private readonly Dictionary<Type, IService> _services; private readonly Dictionary<Type, IService> _services;
internal DiscordClient Client { get; } internal DiscordClient Client { get; }
@@ -37,5 +37,7 @@ namespace Discord
throw new InvalidOperationException($"This operation requires {typeof(T).Name} to be added to {nameof(DiscordClient)}."); throw new InvalidOperationException($"This operation requires {typeof(T).Name} to be added to {nameof(DiscordClient)}.");
return singletonT; return singletonT;
} }
public IEnumerator GetEnumerator() => _services.Values.GetEnumerator();
} }
} }