This repository has been archived on 2025-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
ADEPT/ADEPT-Godot/Core/Scripts/Main.cs

42 lines
1.2 KiB
C#

using System.Reflection;
using Godot;
using ADEPT.Core;
using ADEPT.Core.Cogwheel;
using Cogwheel;
namespace ADEPT.Core;
public partial class Main : Node
{
private static CommandsManager _commandsManager;
private static ICogwheelConsole _cogwheelConsole;
public CanvasLayer MainCanvas { get; private set; }
public override void _Ready()
{
MainCanvas = GetNode<CanvasLayer>("MainCanvas");
ADEPT.Initialize(this);
_commandsManager = new CommandsManager();
_cogwheelConsole = MainCanvas.GetNode<GodotCogwheelConsole>("CogwheelConsole");
if (_cogwheelConsole is null) throw new System.Exception("CogwheelConsole not found in MainNode.");
_commandsManager.AddAssembly(Assembly.GetExecutingAssembly());
_commandsManager.AddAssembly(Assembly.GetAssembly(typeof(CommandsManager)));
COGWHEEL.Initialize(_commandsManager, _cogwheelConsole);
GD.Print("ADEPT initialized.");
COGWHEEL.RegisterObject(this);
}
[Command(Name = "test", Description = "Test command.")]
private void Test()
{
COGWHEEL.LogWarning("Testing!\nTesting!\nTesting!");
}
}