Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should the library deal with known game-specific properties? #35

Closed
herzbube opened this issue Nov 26, 2020 · 2 comments
Closed

How should the library deal with known game-specific properties? #35

herzbube opened this issue Nov 26, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@herzbube
Copy link
Owner

The SGF standard website has sub-pages for 7 game types where a number of game-specific properties are described. One of the game types is Go, which is well-supported by SGFC. The other 6 game types are not supported by SGFC, it does not parse property values and instead passes them on to libsgfc++ as raw string values, just as it would for any other custom property.

libsgfc++ on the other hand expects that SGFC parses these properties and passes values on with a certain structuring already done (e.g. separating values if the property's value type is a composed value type). The groundwork for this can be found in SgfcPropertyMetaInfo where many game-specific properties are assigned a value type descriptor.

Because of the described mismatch, libsgfc++ usually will abort reading in SGF content for the mentioned 6 game types, with SgfcMessageID::SGFCInterfacingError. This situation needs to be resolved:

@herzbube herzbube added the enhancement New feature or request label Nov 26, 2020
@herzbube herzbube added this to the 1.0 milestone Nov 26, 2020
@herzbube herzbube self-assigned this Nov 26, 2020
@herzbube
Copy link
Owner Author

Copied this comment over from another issue. It describes the issue as outlined in the original issue comment, but with different wording.

The current status is that if the SGF content contains a property that is not known to SGFC it will be passed on to libsgfc++ without any particular handling. This is relatively OK for single value properties that have the value type SimpleText and Text, but for all other properties with more restrictive requirements this is a problem because libsgfc++ expects that SGFC performs a certain pre-processing, according to the internal value type descriptor assigned to that particular property.

Examples:

  • A Double value type property where SGFC does not check that the property value is "1" or "2".
  • A Color value type property where SGFC does not check that the property value is "B" or "W".
  • A Number or Real value type property where SGFC does not check that the property value is numeric.
  • A composed value property where SGFC does not perform the separation into value 1 and value 2.

The last example is the most critical, because it causes libsgfc++ (SgfcPropertyDecoder) to throw an exception (std::domain_error) because it detects an interfacing problem with SGFC.

@herzbube
Copy link
Owner Author

Decision: Remove support for properties to no longer hold up a potential 1.0 release in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant