diff --git a/Hangman.SDK.csproj b/Hangman.SDK.csproj index f5f92e2..82d9b99 100644 --- a/Hangman.SDK.csproj +++ b/Hangman.SDK.csproj @@ -6,9 +6,17 @@ disable false false + Hangman.SDK + true + 0.0.1 + Hangman + + + + diff --git a/build/.targets b/build/.targets new file mode 100644 index 0000000..bd447c1 --- /dev/null +++ b/build/.targets @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/build/publish b/build/publish new file mode 100644 index 0000000..a408f57 --- /dev/null +++ b/build/publish @@ -0,0 +1,2 @@ +#!/bin/bash +dotnet nuget push "$(ls -t ../.godot/mono/temp/bin/Debug/Hangman.SDK.*.nupkg | head -n 1)" --source hangman-lab \ No newline at end of file diff --git a/src/Scenes/RootScene.cs b/src/Scenes/RootScene.cs new file mode 100644 index 0000000..c40679c --- /dev/null +++ b/src/Scenes/RootScene.cs @@ -0,0 +1,19 @@ +using Godot; + +namespace Hangman.SDK.Scenes; + +public abstract partial class RootScene : Node2D +{ + private Scene CurrentScene { get; set; } + + public void SwitchScene(Scene scene) + { + if (CurrentScene != null) + RemoveChild(CurrentScene); + AddChild(scene); + CurrentScene = scene; + } + + + +} \ No newline at end of file diff --git a/src/Scenes/Scene.cs b/src/Scenes/Scene.cs new file mode 100644 index 0000000..99605ca --- /dev/null +++ b/src/Scenes/Scene.cs @@ -0,0 +1,8 @@ +using Godot; + +namespace Hangman.SDK.Scenes; + +public abstract partial class Scene : Node2D +{ + +} \ No newline at end of file diff --git a/src/Utils.cs b/src/Utils.cs new file mode 100644 index 0000000..be23daa --- /dev/null +++ b/src/Utils.cs @@ -0,0 +1,18 @@ +using System.Reflection; + +namespace Hangman.SDK; + +public static class Utils +{ + public static IEnumerable GetLoadableTypes(Assembly assembly) + { + try + { + return assembly.GetTypes(); + } + catch (ReflectionTypeLoadException e) + { + return e.Types.Where(t => t != null); + } + } +} \ No newline at end of file