improve: rename project

This commit is contained in:
h z
2025-02-06 01:30:53 +00:00
parent c47c2088cf
commit 022b64bc2c
10 changed files with 42 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
namespace Hangman.SDK.Attributes;
namespace Polonium.Attributes;
[AttributeUsage(AttributeTargets.Class)]
public class AutoRegister : Attribute
{

25
src/Scenes/CameraScene.cs Normal file
View File

@@ -0,0 +1,25 @@
using Godot;
namespace Polonium.Scenes;
public abstract partial class CameraScene : Scene
{
private Camera2D Camera { get; set; }
protected abstract float MaxZoom { get; }
protected abstract float MinZoom { get; }
protected abstract float ZoomRate { get; }
private float Zoom
{
get => Camera.Zoom.X;
set => Camera.Zoom = value * Vector2.One;
}
public override void _Ready()
{
Camera = GetNode<Camera2D>("Camera");
base._Ready();
}
protected void ZoomIn() => Mathf.Max(Zoom * (1 + ZoomRate), MaxZoom);
protected void ZoomOut() => Mathf.Min(Zoom * (1 - ZoomRate), MinZoom);
protected void ZoomAt(Vector2 pos) => Camera.Position = pos;
}

View File

@@ -1,12 +1,12 @@
using Godot;
namespace Hangman.SDK.Scenes;
namespace Polonium.Scenes;
public abstract partial class RootScene : Node2D
{
private Scene CurrentScene { get; set; }
private Polonium.Scenes.Scene CurrentScene { get; set; }
public void SwitchScene(Scene scene)
public void SwitchScene(Polonium.Scenes.Scene scene)
{
if (CurrentScene != null)
RemoveChild(CurrentScene);

View File

@@ -1,6 +1,6 @@
using Godot;
namespace Hangman.SDK.Scenes;
namespace Polonium.Scenes;
public abstract partial class Scene : Node2D
{

View File

@@ -1,6 +1,6 @@
using System.Reflection;
namespace Hangman.SDK;
namespace Polonium;
public static class Utils
{