def root(self) -> "GameNode":
        """Gets the root node, i.e., the game."""
        node = self

        while node.parent:
            node = node.parent

        return node
def root ( self ) -> "GameNode" : node = self while node . parent : node = node . parent return node
Gets the root node, i.e., the game.