Skip to content

Commit 63bf00b

Browse files
Remove old API from GameFramework.cs
1 parent 3b91d9a commit 63bf00b

5 files changed

Lines changed: 20 additions & 30 deletions

File tree

Template.OptionsGen/OptionsGen/OptionsGen.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<NoWarn>NU5128</NoWarn>
1313

1414
<!-- Package Settings -->
15-
<Version>1.0.3</Version>
15+
<Version>1.0.4</Version>
1616
<PackageId>Template.OptionsGen</PackageId>
1717
<AssemblyName>Template.OptionsGen</AssemblyName>
1818
<Description>Strongly typed options settings source generator for CSharpGodotTools/Template</Description>

Template/Framework/Debugging/GameFramework.cs

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ namespace __TEMPLATE__;
77

88
public partial class Game
99
{
10-
private static GameServices? _services;
10+
public static GameComponentManager ComponentManager => RuntimeServices.ComponentManager;
11+
public static GameConsole Console => RuntimeServices.GameConsole;
1112

12-
private static GameServices RuntimeServices =>
13-
_services ?? throw new InvalidOperationException("Game services are not initialized yet.");
13+
public static IAudioService Audio => RuntimeServices.Audio;
14+
public static IOptionsService Options => RuntimeServices.Options;
15+
public static IMetricsOverlay Metrics => RuntimeServices.Metrics;
16+
public static ISceneService Scene => RuntimeServices.Scene;
17+
18+
public static Profiler Profiler => RuntimeServices.Profiler;
19+
public static Services Services => RuntimeServices.ScopedServices;
20+
21+
public static FocusOutlineManager FocusOutline => RuntimeServices.FocusOutline;
22+
23+
public static ILoggerService Logger => RuntimeServices.Logger;
24+
25+
public static IApplicationLifetime Application => RuntimeServices.ApplicationLifetime;
1426

1527
internal static void Initialize(GameServices services)
1628
{
@@ -34,30 +46,8 @@ internal static void Reset()
3446
_services = null;
3547
}
3648

37-
public static GameComponentManager ComponentManager => RuntimeServices.ComponentManager;
38-
public static GameConsole Console => RuntimeServices.GameConsole;
39-
public static GameConsole GameConsole => RuntimeServices.GameConsole;
40-
41-
public static IAudioService Audio => RuntimeServices.Audio;
42-
public static AudioManager AudioManager => RuntimeServices.AudioManager;
43-
44-
public static IOptionsService Options => RuntimeServices.Options;
45-
public static OptionsManager OptionsManager => RuntimeServices.OptionsManager;
46-
public static OptionsSettings Settings => RuntimeServices.Options.Settings;
47-
48-
public static IMetricsOverlay Metrics => RuntimeServices.Metrics;
49-
50-
public static ISceneService Scene => RuntimeServices.Scene;
51-
public static SceneManager SceneManager => RuntimeServices.SceneManager;
52-
53-
public static Profiler Profiler => RuntimeServices.Profiler;
54-
public static Services Services => RuntimeServices.ScopedServices;
55-
public static Services ScopedServices => RuntimeServices.ScopedServices;
56-
57-
public static FocusOutlineManager FocusOutline => RuntimeServices.FocusOutline;
58-
59-
public static ILoggerService Logger => RuntimeServices.Logger;
60-
public static Logger LoggerManager => RuntimeServices.LoggerManager;
49+
private static GameServices? _services;
6150

62-
public static IApplicationLifetime Application => RuntimeServices.ApplicationLifetime;
51+
private static GameServices RuntimeServices =>
52+
_services ?? throw new InvalidOperationException("Game services are not initialized yet.");
6353
}
-11.9 KB
Binary file not shown.
11.9 KB
Binary file not shown.

Template/Template.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- https://github.com/Cat-Lips/GodotSharp.SourceGenerators -->
3232
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.7.0-260208-1601.Release" />
3333
<PackageReference Include="PacketGen" Version="1.3.20" />
34-
<PackageReference Include="Template.OptionsGen" Version="1.0.3" />
34+
<PackageReference Include="Template.OptionsGen" Version="1.0.4" />
3535

3636
<!-- gdUnit4 package dependencies -->
3737
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />

0 commit comments

Comments
 (0)