namespace CMSGame { public static class NodeExtension { public static T GetAutoloadNode(this Node parent, string autoloadName) where T : Node { return parent.GetNode($"/root/{autoloadName}"); } public static void GetAutoloadNode(this Node parent, ref T? node, string autoloadName) where T : Node { node = parent.GetAutoloadNode(autoloadName); } public static T GetUniqueNode(this Node parent, string uniqueName) where T : Node { return parent.GetNode($"%{uniqueName}"); } public static void GetUniqueNode(this Node parent, ref T? node, string uniqueName) where T : Node { node = parent.GetUniqueNode(uniqueName); } } }