Having a BadukGame object is nice since you can store state, however, I can't think of a good way to serialize a BadukGame into, say, JSON, and then parse it back into a BadukGame object.
There's already a function called koString that serializes the state into a string. Can we perhaps have a constructor that takes a koString, and constructs the game from that string? alternatively, we can create a new instance method toJSON that serializes a game to JSON, and a static method called fromJSON that creates a BadukGame from JSON.
Thoughts?
Having a
BadukGameobject is nice since you can store state, however, I can't think of a good way to serialize aBadukGameinto, say, JSON, and then parse it back into aBadukGameobject.There's already a function called
koStringthat serializes the state into a string. Can we perhaps have a constructor that takes akoString, and constructs the game from that string? alternatively, we can create a new instance methodtoJSONthat serializes a game to JSON, and a static method calledfromJSONthat creates aBadukGamefrom JSON.Thoughts?