
using Godot;
using System.Collections.Generic;

namespace Rokojori
{  
  public enum AppPlatformOS
  {
    Windows,
    MacOS,    
    iOS,
    Android,
    MetaHorizonOS,
    Switch,
    Switch2,
    PS4,
    PS5,
    XBoxOne,
    XBoxSeriesXS
  }

  public enum AppLauncher
  {
    Native,
    Steam,
    Epic,
    Web
  }

  [Tool]
  [GlobalClass,Icon("res://addons/rokojori_action_library/Icons/SensorManager.svg")]
  public partial class App: Node
  { 
    [Export]
    public AppPlatformOS os;

    [Export]
    public AppLauncher launcher;

    int _fps = 60;
    
    public int x = 0;
    
    [Export]
    public int fps 
    {
      get => _fps;
      set { _fps = value; Engine.MaxFps = _fps; }
    }

  

    // [ExportToolButton( "Initialize")]
    // public Callable InitializeButton => Callable.From( Initialize );

    public void Initialize()
    {
      var types = new List<System.Type>{
        typeof ( TimeLineManager ),
        typeof ( SensorManager ),
        typeof ( NetworkManager ),
        typeof ( LocaleManager ),
        typeof ( VirtualCamera3DManager ),
        typeof ( MouseEditorCamera ),
        typeof ( Camera3D ),
        typeof ( UI )

      };

      types.ForEach(
        ( t )=>
        {
          this.LogInfo( "Creating:", t.Name );
          this.CreateChildWithType( t, t.Name );
        }
      );

      


    }

    void InitializeCamera()
    {
      var cameraManager = this.Get<VirtualCamera3DManager>();
      var camera = this.Get<Camera3D>();

      cameraManager.camera = camera;
      var slot = cameraManager.CreateChild<VirtualCamera3DSlot>();
      slot.camera = this.Get<MouseEditorCamera>();

    }
  

    
  }
}