From 8324dbe828434310b24573f7c4f659a3be86bcc4 Mon Sep 17 00:00:00 2001 From: mtj0928 Date: Wed, 31 Dec 2025 17:40:20 +0900 Subject: [PATCH] Refine interface --- Sources/SGFKit/Collection+SGF.swift | 4 ++-- Sources/SGFKit/Node.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SGFKit/Collection+SGF.swift b/Sources/SGFKit/Collection+SGF.swift index b1ee2d9..fef6c84 100644 --- a/Sources/SGFKit/Collection+SGF.swift +++ b/Sources/SGFKit/Collection+SGF.swift @@ -1,12 +1,12 @@ extension Collection { /// Converts the collection to a SGF text. - func convertToSGF() -> String { + public func convertToSGF() -> String { convertToNonTerminalSymbol().convertToSGF() } /// Converts the collection to non terminal symbols. - func convertToNonTerminalSymbol() -> NonTerminalSymbols.Collection { + public func convertToNonTerminalSymbol() -> NonTerminalSymbols.Collection { let gameTrees = nodes.map { gameTree(from: $0) } return NonTerminalSymbols.Collection(gameTrees: gameTrees) } diff --git a/Sources/SGFKit/Node.swift b/Sources/SGFKit/Node.swift index 5f9bbf2..a823d17 100644 --- a/Sources/SGFKit/Node.swift +++ b/Sources/SGFKit/Node.swift @@ -37,7 +37,7 @@ public final class Node { /// Makes the node. /// - Parameter properties: The property of the node. - public init(properties: [Property]) { + public init(properties: [Property] = []) { self.number = nil self.properties = properties }