herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 54 forks source link

Change app model for storing handicap to better reflect the SGF properties HA and AB #403

Closed herzbube closed 4 months ago

herzbube commented 1 year ago

Currently handicap stones are stored in the GoGame property handicapPoints, which is an array of GoPoint objects. The property value therefore stores two pieces of SGF information at the same time:

The property can be seen as part of board position 0 (zero), i.e. the root node. At the same time, the root node can also store setup information in a GoNodeSetup object. It would thus be possible for GoNodeSetup to clear handicap stones (corresponding to the effect of the SGF property AE), or replace them with white setup stones (corresponding to the effect of the SGF property AW). If this were allowed, saving the data to an SGF file and then reloading that SGF file would lose information.

Saving the data to an SGF file would result in the following content in the game info node:

Reloading the SGF file would result in the GoGame property handicapPoints to have a different value than at the time when the SGF file was saved.

To avoid this data loss, the app currently has to take special measures when the user is interactively setting up the board while at board position 0, and is removing a handicap stone, or replacing it with a white setup stone:

In addition to this, the following coding items exists:

The special measures during interactive board setup, as well as the coding items in the above list, could be removed if the app's data model for storing handicap would be changed to be the same as SGF. In other words:

Once these two changes to the data model are made, the following code modifications can be performed (list is probably not complete):

herzbube commented 4 months ago

Closing this because of "Won't fix" decision.

Rationale: The gap allowed by the SGF data model (handicap < number of black setup stones) is deemed to be not acceptable at this moment.