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("MainCanvas"); ADEPT.Initialize(this); _commandsManager = new CommandsManager(); _cogwheelConsole = MainCanvas.GetNode("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!"); } }