-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainInstaller.cs
53 lines (44 loc) · 1.2 KB
/
MainInstaller.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
// ReSharper disable once CheckNamespace
namespace GameLovers.Services
{
/// <inheritdoc cref="IInstaller"/>
/// <remarks>
/// Use this installer for generic Binding interfaces that are available in the entire scope of the game
/// </remarks>
public static class MainInstaller
{
private static readonly IInstaller _installer = new Installer();
/// <inheritdoc cref="IInstaller.Bind{T}"/>
public static void Bind<T>(T instance) where T : class
{
_installer.Bind(instance);
}
/// <inheritdoc cref="IInstaller.TryResolve{T}"/>
public static bool TryResolve<T>(out T instance)
{
return _installer.TryResolve(out instance);
}
/// <inheritdoc cref="IInstaller.Resolve{T}"/>
public static T Resolve<T>()
{
return _installer.Resolve<T>();
}
/// <inheritdoc cref="IInstaller.Clean"/>
public static bool Clean<T>() where T : class
{
return _installer.Clean<T>();
}
/// <inheritdoc cref="IInstaller.Clean"/>
public static bool CleanDispose<T>() where T : class, IDisposable
{
_installer.Resolve<T>().Dispose();
return _installer.Clean<T>();
}
/// <inheritdoc cref="IInstaller.Clean"/>
public static void Clean()
{
_installer.Clean();
}
}
}