Proper delegate naming

This commit is contained in:
Westin Miller
2017-08-22 08:04:22 -07:00
parent a4b1b9bb96
commit 6ce679bd83
2 changed files with 7 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ namespace Torch.API.Session
/// </remarks>
/// <param name="session">The session to construct a bound manager for</param>
/// <returns>The manager that will live in the session, or null if none.</returns>
public delegate IManager SessionManagerFactory(ITorchSession session);
public delegate IManager SessionManagerFactoryDel(ITorchSession session);
/// <summary>
/// Manages the creation and destruction of <see cref="ITorchSession"/> instances for each <see cref="Sandbox.Game.World.MySession"/> created by Space Engineers.
@@ -33,7 +33,7 @@ namespace Torch.API.Session
/// <param name="factory">Session based manager supplier</param>
/// <returns>true if added, false if already present</returns>
/// <exception cref="ArgumentNullException">If the factory is null</exception>
bool AddFactory(SessionManagerFactory factory);
bool AddFactory(SessionManagerFactoryDel factory);
/// <summary>
/// Remove the given factory from the suppliers for session based managers
@@ -41,6 +41,6 @@ namespace Torch.API.Session
/// <param name="factory">Session based manager supplier</param>
/// <returns>true if removed, false if not present</returns>
/// <exception cref="ArgumentNullException">If the factory is null</exception>
bool RemoveFactory(SessionManagerFactory factory);
bool RemoveFactory(SessionManagerFactoryDel factory);
}
}

View File

@@ -24,14 +24,14 @@ namespace Torch.Session
/// <inheritdoc/>
public ITorchSession CurrentSession => _currentSession;
private readonly HashSet<SessionManagerFactory> _factories = new HashSet<SessionManagerFactory>();
private readonly HashSet<SessionManagerFactoryDel> _factories = new HashSet<SessionManagerFactoryDel>();
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
{
}
/// <inheritdoc/>
public bool AddFactory(SessionManagerFactory factory)
public bool AddFactory(SessionManagerFactoryDel factory)
{
if (factory == null)
throw new ArgumentNullException(nameof(factory), "Factory must be non-null");
@@ -39,7 +39,7 @@ namespace Torch.Session
}
/// <inheritdoc/>
public bool RemoveFactory(SessionManagerFactory factory)
public bool RemoveFactory(SessionManagerFactoryDel factory)
{
if (factory == null)
throw new ArgumentNullException(nameof(factory), "Factory must be non-null");
@@ -56,7 +56,7 @@ namespace Torch.Session
_log.Info($"Starting new torch session for {MySession.Static.Name}");
_currentSession = new TorchSession(Torch, MySession.Static);
foreach (SessionManagerFactory factory in _factories)
foreach (SessionManagerFactoryDel factory in _factories)
{
IManager manager = factory(CurrentSession);
if (manager != null)