Move App logic to other projects

This commit is contained in:
2025-03-07 01:08:35 -08:00
parent 3b5ee84ce2
commit 1cb79f5b30
49 changed files with 185 additions and 205 deletions

View File

@@ -2,7 +2,11 @@
using Chickensoft.GodotNodeInterfaces;
using Chickensoft.Introspection;
using Godot;
using static Zennysoft.Game.Ma.AppLogic.Input;
using SimpleInjector;
using SimpleInjector.Lifestyles;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Ma.Implementation;
using static Zennysoft.Game.Ma.Implementation.AppLogic.Input;
namespace Zennysoft.Game.Ma;
@@ -35,9 +39,17 @@ public partial class App : CanvasLayer, IApp
public void Initialize()
{
var container = new SimpleInjector.Container();
container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
container.Register<IAppRepo, AppRepo>(Lifestyle.Singleton);
container.Register<IAppLogic, AppLogic>(Lifestyle.Singleton);
container.Verify();
Instantiator = new Instantiator(GetTree());
AppRepo = new AppRepo();
AppLogic = new AppLogic();
AppRepo = container.GetInstance<IAppRepo>();
AppLogic = container.GetInstance<IAppLogic>();
AppLogic.Set(AppRepo);
AppLogic.Set(new AppLogic.Data());