using Godot;


namespace Rokojori
{  
  [Tool]
  public partial class Root:Node
  {
    private static Root _singleton;

    public override void _Ready()
    {
      _singleton = this;
    }

    public static SceneTree Tree()
    {
      if ( _singleton == null )
      {
        return null;
      }

      return _singleton.GetTree();
    }

    public static Window Window()
    {
      var tree = Tree();

      if ( tree == null)
      {
        return null;
      }

      return tree.Root;
    }

    static Root Get()
    {
      var r = Window();

      return _singleton;
    }
  }
}