Skip to content

Commit 6a2518d

Browse files
Merge pull request #13 from CoderGamester/develop
Release 0.8.0
2 parents 2f7534e + b8efa18 commit 6a2518d

8 files changed

Lines changed: 572 additions & 4 deletions

Runtime/GameLovers.Services.asmdef

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "GameLovers.Services",
3-
"references": [],
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:22c6cdfa54ae844a9a9eda2f0014b020"
6+
],
47
"includePlatforms": [],
58
"excludePlatforms": [],
69
"allowUnsafeCode": false,

Runtime/MainInstaller.cs

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

Runtime/MainInstaller.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)