Proper delegate naming
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Torch.API.Session
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="session">The session to construct a bound manager for</param>
|
/// <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>
|
/// <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>
|
/// <summary>
|
||||||
/// Manages the creation and destruction of <see cref="ITorchSession"/> instances for each <see cref="Sandbox.Game.World.MySession"/> created by Space Engineers.
|
/// 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>
|
/// <param name="factory">Session based manager supplier</param>
|
||||||
/// <returns>true if added, false if already present</returns>
|
/// <returns>true if added, false if already present</returns>
|
||||||
/// <exception cref="ArgumentNullException">If the factory is null</exception>
|
/// <exception cref="ArgumentNullException">If the factory is null</exception>
|
||||||
bool AddFactory(SessionManagerFactory factory);
|
bool AddFactory(SessionManagerFactoryDel factory);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove the given factory from the suppliers for session based managers
|
/// 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>
|
/// <param name="factory">Session based manager supplier</param>
|
||||||
/// <returns>true if removed, false if not present</returns>
|
/// <returns>true if removed, false if not present</returns>
|
||||||
/// <exception cref="ArgumentNullException">If the factory is null</exception>
|
/// <exception cref="ArgumentNullException">If the factory is null</exception>
|
||||||
bool RemoveFactory(SessionManagerFactory factory);
|
bool RemoveFactory(SessionManagerFactoryDel factory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,14 +24,14 @@ namespace Torch.Session
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ITorchSession CurrentSession => _currentSession;
|
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)
|
public TorchSessionManager(ITorchBase torchInstance) : base(torchInstance)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool AddFactory(SessionManagerFactory factory)
|
public bool AddFactory(SessionManagerFactoryDel factory)
|
||||||
{
|
{
|
||||||
if (factory == null)
|
if (factory == null)
|
||||||
throw new ArgumentNullException(nameof(factory), "Factory must be non-null");
|
throw new ArgumentNullException(nameof(factory), "Factory must be non-null");
|
||||||
@@ -39,7 +39,7 @@ namespace Torch.Session
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool RemoveFactory(SessionManagerFactory factory)
|
public bool RemoveFactory(SessionManagerFactoryDel factory)
|
||||||
{
|
{
|
||||||
if (factory == null)
|
if (factory == null)
|
||||||
throw new ArgumentNullException(nameof(factory), "Factory must be non-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}");
|
_log.Info($"Starting new torch session for {MySession.Static.Name}");
|
||||||
_currentSession = new TorchSession(Torch, MySession.Static);
|
_currentSession = new TorchSession(Torch, MySession.Static);
|
||||||
foreach (SessionManagerFactory factory in _factories)
|
foreach (SessionManagerFactoryDel factory in _factories)
|
||||||
{
|
{
|
||||||
IManager manager = factory(CurrentSession);
|
IManager manager = factory(CurrentSession);
|
||||||
if (manager != null)
|
if (manager != null)
|
||||||
|
Reference in New Issue
Block a user