libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The ISgfcGameInfo interface ia a collection of meta data that describes one SGF game. For instance, the meta data includes information such as the name of the game, when and where it was played, by whom, etc. More...
#include <ISgfcGameInfo.h>
Public Member Functions | |
ISgfcGameInfo () | |
Initializes a newly constructed ISgfcGameInfo object. | |
virtual | ~ISgfcGameInfo () |
Destroys and cleans up the ISgfcGameInfo object. | |
Root properties (read only) | |
virtual SgfcGameType | GetGameType () const =0 |
Returns the game type. The default value is SgfcConstants::DefaultGameType. | |
virtual SgfcNumber | GetGameTypeAsNumber ()=0 |
Returns the game type as an SgfcNumber value. The default value is the SgfcNumber value that corresponds to SgfcConstants::DefaultGameType. | |
virtual SgfcBoardSize | GetBoardSize () const =0 |
Returns the size of the board on which the game was played. The default value is the default board size for SgfcConstants::DefaultGameType. | |
Game data information | |
virtual SgfcSimpleText | GetRecorderName () const =0 |
Returns the name of the user (or program) who recorded or entered the game data. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetRecorderName (const SgfcSimpleText &recorderName)=0 |
Sets the name of the user (or program) who recorded or entered the game data. | |
virtual SgfcSimpleText | GetSourceName () const =0 |
Returns the name of the source of the game data (e.g. book, journal, etc.). The default value is SgfcConstants::NoneValueString. | |
virtual void | SetSourceName (const SgfcSimpleText &sourceName)=0 |
Sets the name of the source of the game data (e.g. book, journal, etc.). | |
virtual SgfcSimpleText | GetAnnotationAuthor () const =0 |
Returns the name of the person who made the annotations to the game. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetAnnotationAuthor (const SgfcSimpleText &annotationAuthor)=0 |
Sets the name of the person who made the annotations to the game. | |
virtual SgfcSimpleText | GetCopyrightInformation () const =0 |
Returns the copyright information for the game data (including the annotations). The default value is SgfcConstants::NoneValueString. | |
virtual void | SetCopyrightInformation (const SgfcSimpleText ©rightInformation)=0 |
Sets the copyright information for the game data (including the annotations). | |
Basic game information | |
virtual SgfcSimpleText | GetGameName () const =0 |
Returns the name of the game (e.g. for easily finding the game again within a collection). The default value is SgfcConstants::NoneValueString. | |
virtual void | SetGameName (const SgfcSimpleText &gameName)=0 |
Sets the name of the game (e.g. for easily finding the game again within a collection). | |
virtual SgfcText | GetGameInformation () const =0 |
Returns information about the game (e.g. background information, a game summary, etc.). The default value is SgfcConstants::NoneValueString. | |
virtual void | SetGameInformation (const SgfcText &gameInformation)=0 |
Sets information about the game (e.g. background information, a game summary, etc.). | |
virtual std::vector< SgfcDate > | GetGameDates () const =0 |
Returns the dates when the game was played, decomposed into years, optional months and optional days. Several non-consecutive dates are possible. The default value is an empty collection of dates. | |
virtual void | SetGameDates (const std::vector< SgfcDate > &gameDates)=0 |
Sets the dates when the game was played, decomposed into years, optional months and optional days. Several non-consecutive dates are possible. | |
virtual SgfcSimpleText | GetRawGameDates () const =0 |
Returns the dates when the game was played. Several non-consecutive dates are possible. The default value is SgfcConstants::NoneValueString. | |
virtual SgfcSimpleText | GetRulesName () const =0 |
Returns the name of the rules used for the game. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetRulesName (const SgfcSimpleText &rulesName)=0 |
Sets the name of the rules used for the game. | |
virtual SgfcGameResult | GetGameResult () const =0 |
Returns the result of the game, decomposed into an outcome and an optional score. The default value is an SgfcGameResult object which has the IsValid property set to false. | |
virtual void | SetGameResult (SgfcGameResult gameResult)=0 |
Sets the result of the game, decomposed into an outcome and an optional score. | |
virtual SgfcSimpleText | GetRawGameResult () const =0 |
Returns the result of the game. The default value is SgfcConstants::NoneValueString. | |
Extra game information | |
virtual SgfcReal | GetTimeLimitInSeconds () const =0 |
Returns the time limit of the game in seconds. The default value is 0.0. | |
virtual void | SetTimeLimitInSeconds (SgfcReal timeLimitInSeconds)=0 |
Sets the time limit of the game in seconds. | |
virtual SgfcSimpleText | GetOvertimeInformation () const =0 |
Returns the description of the method used for overtime (byo-yomi). The default value is SgfcConstants::NoneValueString. | |
virtual void | SetOvertimeInformation (const SgfcSimpleText &overtimeInformation)=0 |
Sets the description of the method used for overtime (byo-yomi). | |
virtual SgfcSimpleText | GetOpeningInformation () const =0 |
Returns information about the opening played. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetOpeningInformation (const SgfcSimpleText &openingInformation)=0 |
Sets the information about the opening played. | |
Player information | |
virtual SgfcSimpleText | GetBlackPlayerName () const =0 |
Returns the name of the black player. The default value is an empty string. | |
virtual void | SetBlackPlayerName (const SgfcSimpleText &blackPlayerName)=0 |
Sets the name of the black player. | |
virtual SgfcSimpleText | GetBlackPlayerRank () const =0 |
Returns the rank of the black player. The default value is an empty string. | |
virtual void | SetBlackPlayerRank (const SgfcSimpleText &blackPlayerRank)=0 |
Sets the rank of the black player. | |
virtual SgfcSimpleText | GetBlackPlayerTeamName () const =0 |
Returns the name of the black player's team. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetBlackPlayerTeamName (const SgfcSimpleText &blackPlayerTeamName)=0 |
Sets the name of the black player's team. | |
virtual SgfcSimpleText | GetWhitePlayerName () const =0 |
Returns the name of the white player. The default value is an empty string. | |
virtual void | SetWhitePlayerName (const SgfcSimpleText &whitePlayerName)=0 |
Sets the name of the white player. | |
virtual SgfcSimpleText | GetWhitePlayerRank () const =0 |
Returns the rank of the white player. The default value is an empty string. | |
virtual void | SetWhitePlayerRank (const SgfcSimpleText &whitePlayerRank)=0 |
Sets the rank of the white player. | |
virtual SgfcSimpleText | GetWhitePlayerTeamName () const =0 |
Returns the name of the white player's team. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetWhitePlayerTeamName (const SgfcSimpleText &whitePlayerTeamName)=0 |
Sets the name of the white player's team. | |
Context in which the game was played | |
virtual SgfcSimpleText | GetGameLocation () const =0 |
Returns the name or description of the location where the game was played. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetGameLocation (const SgfcSimpleText &gameLocation)=0 |
Sets the name or description of the location where the game was played. | |
virtual SgfcSimpleText | GetEventName () const =0 |
Returns the name of the event (e.g. tournament) where the game was played. The default value is SgfcConstants::NoneValueString. | |
virtual void | SetEventName (const SgfcSimpleText &eventName)=0 |
Sets the name of the event (e.g. tournament) where the game was played. | |
virtual SgfcRoundInformation | GetRoundInformation () const =0 |
Returns the information that describes the round in which the game was played, decomposed into round number and type of round. The default value is an SgfcRoundInformation object which has the IsValid property set to false. | |
virtual void | SetRoundInformation (const SgfcRoundInformation &roundInformation)=0 |
Sets the information that describes the round in which the game was played, decomposed into round number and type of round. | |
virtual SgfcSimpleText | GetRawRoundInformation () const =0 |
Returns the information that describes the round in which the game was played. The default value is SgfcConstants::NoneValueString. | |
virtual const ISgfcGoGameInfo * | ToGoGameInfo () const =0 |
Returns an ISgfcGoGameInfo object if the ISgfcGameInfo object was created specifically for SgfcGameType::Go. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
The ISgfcGameInfo interface ia a collection of meta data that describes one SGF game. For instance, the meta data includes information such as the name of the game, when and where it was played, by whom, etc.
ISgfcGame or ISgfcNode can be queried to provide an ISgfcGameInfo object. The object is newly created and contains a snapshot of the property values of a few root properties (SgfcPropertyCategory::Root) and all game info properties (SgfcPropertyCategory::GameInfo) found in the root node and the game info node, respectively, at the time the query is made.
Alternatively a new but empty ISgfcGameInfo object can be created via SgfcPlusPlusFactory and then populated with data as the library client sees fit. The empty ISgfcGameInfo object is initialized with default values.
The values that an ISgfcGameInfo object holds can be written to an ISgfcGame or ISgfcNode. The values are converted to properties and property values that are then stored in the root node and the game info node, respectively. Properties and property values that already exist at that time are either overwritten, or removed if the value to be written is the default value.
Root property values are read-only - they must be provided at the time the ISgfcGameInfo object is constructed and cannot be changed later on. The reason is that changing these values in an ISgfcGameInfo object that was captured from a game tree and then later writing the ISgfcGameInfo object data back to the game tree would likely invalidate most if not all of the game tree's data.
|
pure virtual |
Returns the name of the person who made the annotations to the game. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the black player. The default value is an empty string.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the rank of the black player. The default value is an empty string.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the black player's team. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the size of the board on which the game was played. The default value is the default board size for SgfcConstants::DefaultGameType.
Returns SgfcConstants::BoardSizeNone or SgfcConstants::BoardSizeInvalid if there is a problem with determining a valid board size from the SZ property. See ISgfcGame::GetBoardSize() for details.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the copyright information for the game data (including the annotations). The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the event (e.g. tournament) where the game was played. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the dates when the game was played, decomposed into years, optional months and optional days. Several non-consecutive dates are possible. The default value is an empty collection of dates.
The returned collection is also empty if there is a problem with decomposing the raw property value. See SgfcDate::FromPropertyValue() for details. An indicator that this happened is if GetRawGameDates() returns a value that is not equal to SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns information about the game (e.g. background information, a game summary, etc.). The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name or description of the location where the game was played. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the game (e.g. for easily finding the game again within a collection). The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the result of the game, decomposed into an outcome and an optional score. The default value is an SgfcGameResult object which has the IsValid property set to false.
The returned SgfcGameResult also has the IsValid property set to false if there is a problem with decomposing the raw property value. See SgfcGameResult::FromPropertyValue() for details. An indicator that this happened is if GetRawGameResult() returns a value that is not equal to SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the game type. The default value is SgfcConstants::DefaultGameType.
Returns SgfcGameType::Unknown if the Number value of the GM property is not in the list of valid games defined in the SGF standard.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the game type as an SgfcNumber value. The default value is the SgfcNumber value that corresponds to SgfcConstants::DefaultGameType.
This is useful if GetGameType() returns SgfcGameType::Unknown because the Number value of the GM property is not in the list of valid games defined in the SGF standard.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns information about the opening played. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the description of the method used for overtime (byo-yomi). The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the dates when the game was played. Several non-consecutive dates are possible. The default value is SgfcConstants::NoneValueString.
This is useful if the raw game dates cannot be decomposed into years, optional months and optional days, as is required by the SGF standard for SgfcPropertyType::DT.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the result of the game. The default value is SgfcConstants::NoneValueString.
This is useful if the raw game result cannot be decomposed into an outcome and an optional score as is required by the SGF standard for SgfcPropertyType::RE.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the information that describes the round in which the game was played. The default value is SgfcConstants::NoneValueString.
This is useful if the raw round information cannot be decomposed into round number and type of round as recommended by the SGF standard for SgfcPropertyType::RO.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the user (or program) who recorded or entered the game data. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the information that describes the round in which the game was played, decomposed into round number and type of round. The default value is an SgfcRoundInformation object which has the IsValid property set to false.
The returned SgfcRoundInformation also has the IsValid property set to false if there is a problem with decomposing the raw property value. See SgfcRoundInformation::FromPropertyValue() for details. An indicator that this happened is if GetRawRoundInformation() returns a value that is not equal to SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the rules used for the game. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the source of the game data (e.g. book, journal, etc.). The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the time limit of the game in seconds. The default value is 0.0.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the white player. The default value is an empty string.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the rank of the white player. The default value is an empty string.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns the name of the white player's team. The default value is SgfcConstants::NoneValueString.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the person who made the annotations to the game.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the black player.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the rank of the black player.
Implemented in LibSgfcPlusPlus::SgfcGoGameInfo, and LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the black player's team.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the copyright information for the game data (including the annotations).
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the event (e.g. tournament) where the game was played.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the dates when the game was played, decomposed into years, optional months and optional days. Several non-consecutive dates are possible.
Invoking this setter also changes the information returned by GetRawGameDates().
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets information about the game (e.g. background information, a game summary, etc.).
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name or description of the location where the game was played.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the game (e.g. for easily finding the game again within a collection).
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the result of the game, decomposed into an outcome and an optional score.
Invoking this setter also changes the information returned by GetRawGameResult().
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the information about the opening played.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the description of the method used for overtime (byo-yomi).
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the user (or program) who recorded or entered the game data.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the information that describes the round in which the game was played, decomposed into round number and type of round.
Invoking this setter also changes the information returned by GetRawRoundInformation().
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the rules used for the game.
Implemented in LibSgfcPlusPlus::SgfcGoGameInfo, and LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the source of the game data (e.g. book, journal, etc.).
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the time limit of the game in seconds.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the white player.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the rank of the white player.
Implemented in LibSgfcPlusPlus::SgfcGoGameInfo, and LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Sets the name of the white player's team.
Implemented in LibSgfcPlusPlus::SgfcGameInfo.
|
pure virtual |
Returns an ISgfcGoGameInfo object if the ISgfcGameInfo object was created specifically for SgfcGameType::Go. Returns nullptr otherwise. The caller is not the owner of the returned object.
Implemented in LibSgfcPlusPlus::SgfcGoGameInfo, and LibSgfcPlusPlus::SgfcGameInfo.