com.puzzlescapegames.services 1.0.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,8 +73,9 @@ namespace PuzzlescapeGames.Services.Editor
73
73
  {
74
74
  NONE = 0,
75
75
  ENABLED_APPSFLYER = 1 << 0,
76
- ENABLED_FIREBASE = 1 << 1,
77
- UNITASK_DOTWEEN_SUPPORT = 1 << 2,
76
+ ENABLED_AMPLITUDE = 1 << 1,
77
+ ENABLED_FIREBASE = 1 << 2,
78
+ UNITASK_DOTWEEN_SUPPORT = 1 << 4,
78
79
  ALL = ~0,
79
80
  }
80
81
  }
@@ -62,15 +62,22 @@ namespace PuzzlescapeGames.Services
62
62
 
63
63
  public R GetAs< R >()
64
64
  where R : class, T =>
65
- Get<R>() as R;
66
-
65
+ Get< R >() as R;
66
+
67
67
  public T Get< R >()
68
68
  where R : T
69
69
  {
70
- if ( ContainsType< R >() ) return _registers.Where( x => x is R ).FirstOrDefault();
70
+ if ( ContainsType< R >() ) return _registers.FirstOrDefault( x => x is R );
71
71
 
72
72
  throw new Exception( $"REGISTRATOR DOESN'T CONTAINS {typeof(R)} ERROR" );
73
73
  }
74
+
75
+ public T Get( Type registr )
76
+ {
77
+ if ( ContainsType( registr ) ) return _registers.FirstOrDefault( x => x.GetType() == registr );
78
+
79
+ throw new Exception( $"REGISTRATOR DOESN'T CONTAINS {registr} ERROR" );
80
+ }
74
81
 
75
82
  public bool ContainsType< R >()
76
83
  where R : T =>
@@ -79,7 +86,7 @@ namespace PuzzlescapeGames.Services
79
86
  public bool ContainsType< R >( R registr )
80
87
  where R : T
81
88
  {
82
- return _registers.Any( ( x ) => x.GetType() == registr.GetType() );
89
+ return ContainsType( registr.GetType() );
83
90
  }
84
91
 
85
92
  public bool ContainsType( Type registr )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name" : "com.puzzlescapegames.services",
3
3
  "displayName" : "Puzzlescape Games Services",
4
- "version" : "1.0.9",
4
+ "version" : "1.1.1",
5
5
  "author" : "Puzzlescape Games",
6
6
  "description" : "Common services.",
7
7
  "repository": {