libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
LibSgfcPlusPlus::SgfcGameInfo Class Reference

The SgfcGameInfo class provides an implementation of the ISgfcGameInfo interface. See the interface header file for documentation. More...

#include <SgfcGameInfo.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcGameInfo:
LibSgfcPlusPlus::ISgfcGameInfo LibSgfcPlusPlus::SgfcGoGameInfo

Public Member Functions

 SgfcGameInfo ()
 Initializes a newly constructed SgfcGameInfo object with default values.
 
 SgfcGameInfo (std::shared_ptr< ISgfcNode > rootNode)
 Initializes a newly constructed SgfcGameInfo object with values taken from the properties in root node rootNode. All values that would normally be taken from the properties in the game info node have default values.
 
 SgfcGameInfo (std::shared_ptr< ISgfcNode > rootNode, std::shared_ptr< ISgfcNode > gameInfoNode)
 Initializes a newly constructed SgfcGameInfo object with values taken from the properties in root node rootNode and from game info node gameInfoNode.
 
virtual ~SgfcGameInfo ()
 Destroys and cleans up the SgfcGameInfo object.
 
virtual SgfcGameType GetGameType () const override
 Returns the game type. The default value is SgfcConstants::DefaultGameType.
 
virtual SgfcNumber GetGameTypeAsNumber () override
 Returns the game type as an SgfcNumber value. The default value is the SgfcNumber value that corresponds to SgfcConstants::DefaultGameType.
 
virtual SgfcBoardSize GetBoardSize () const override
 Returns the size of the board on which the game was played. The default value is the default board size for SgfcConstants::DefaultGameType.
 
virtual SgfcSimpleText GetRecorderName () const override
 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) override
 Sets the name of the user (or program) who recorded or entered the game data.
 
virtual SgfcSimpleText GetSourceName () const override
 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) override
 Sets the name of the source of the game data (e.g. book, journal, etc.).
 
virtual SgfcSimpleText GetAnnotationAuthor () const override
 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) override
 Sets the name of the person who made the annotations to the game.
 
virtual SgfcSimpleText GetCopyrightInformation () const override
 Returns the copyright information for the game data (including the annotations). The default value is SgfcConstants::NoneValueString.
 
virtual void SetCopyrightInformation (const SgfcSimpleText &copyrightInformation) override
 Sets the copyright information for the game data (including the annotations).
 
virtual SgfcSimpleText GetGameName () const override
 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) override
 Sets the name of the game (e.g. for easily finding the game again within a collection).
 
virtual SgfcText GetGameInformation () const override
 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) override
 Sets information about the game (e.g. background information, a game summary, etc.).
 
virtual std::vector< SgfcDateGetGameDates () const override
 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) override
 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 override
 Returns the dates when the game was played. Several non-consecutive dates are possible. The default value is SgfcConstants::NoneValueString.
 
virtual SgfcSimpleText GetRulesName () const override
 Returns the name of the rules used for the game. The default value is SgfcConstants::NoneValueString.
 
virtual void SetRulesName (const SgfcSimpleText &rulesName) override
 Sets the name of the rules used for the game.
 
virtual SgfcGameResult GetGameResult () const override
 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) override
 Sets the result of the game, decomposed into an outcome and an optional score.
 
virtual SgfcSimpleText GetRawGameResult () const override
 Returns the result of the game. The default value is SgfcConstants::NoneValueString.
 
virtual SgfcReal GetTimeLimitInSeconds () const override
 Returns the time limit of the game in seconds. The default value is 0.0.
 
virtual void SetTimeLimitInSeconds (SgfcReal timeLimitInSeconds) override
 Sets the time limit of the game in seconds.
 
virtual SgfcSimpleText GetOvertimeInformation () const override
 Returns the description of the method used for overtime (byo-yomi). The default value is SgfcConstants::NoneValueString.
 
virtual void SetOvertimeInformation (const SgfcSimpleText &overtimeInformation) override
 Sets the description of the method used for overtime (byo-yomi).
 
virtual SgfcSimpleText GetOpeningInformation () const override
 Returns information about the opening played. The default value is SgfcConstants::NoneValueString.
 
virtual void SetOpeningInformation (const SgfcSimpleText &openingInformation) override
 Sets the information about the opening played.
 
virtual SgfcSimpleText GetBlackPlayerName () const override
 Returns the name of the black player. The default value is an empty string.
 
virtual void SetBlackPlayerName (const SgfcSimpleText &blackPlayerName) override
 Sets the name of the black player.
 
virtual SgfcSimpleText GetBlackPlayerRank () const override
 Returns the rank of the black player. The default value is an empty string.
 
virtual void SetBlackPlayerRank (const SgfcSimpleText &blackPlayerRank) override
 Sets the rank of the black player.
 
virtual SgfcSimpleText GetBlackPlayerTeamName () const override
 Returns the name of the black player's team. The default value is SgfcConstants::NoneValueString.
 
virtual void SetBlackPlayerTeamName (const SgfcSimpleText &blackPlayerTeamName) override
 Sets the name of the black player's team.
 
virtual SgfcSimpleText GetWhitePlayerName () const override
 Returns the name of the white player. The default value is an empty string.
 
virtual void SetWhitePlayerName (const SgfcSimpleText &whitePlayerName) override
 Sets the name of the white player.
 
virtual SgfcSimpleText GetWhitePlayerRank () const override
 Returns the rank of the white player. The default value is an empty string.
 
virtual void SetWhitePlayerRank (const SgfcSimpleText &whitePlayerRank) override
 Sets the rank of the white player.
 
virtual SgfcSimpleText GetWhitePlayerTeamName () const override
 Returns the name of the white player's team. The default value is SgfcConstants::NoneValueString.
 
virtual void SetWhitePlayerTeamName (const SgfcSimpleText &whitePlayerTeamName) override
 Sets the name of the white player's team.
 
virtual SgfcSimpleText GetGameLocation () const override
 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) override
 Sets the name or description of the location where the game was played.
 
virtual SgfcSimpleText GetEventName () const override
 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) override
 Sets the name of the event (e.g. tournament) where the game was played.
 
virtual SgfcRoundInformation GetRoundInformation () const override
 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) override
 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 override
 Returns the information that describes the round in which the game was played. The default value is SgfcConstants::NoneValueString.
 
virtual const ISgfcGoGameInfoToGoGameInfo () const override
 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.
 
virtual void WriteToRootNode (std::shared_ptr< ISgfcNode > rootNode)
 Writes all root property values in the ISgfcGameInfo object to the corresponding properties in rootNode.
 
virtual void WriteToGameInfoNode (std::shared_ptr< ISgfcNode > gameInfoNode)
 Writes all game info property values in the ISgfcGameInfo object to the corresponding properties in gameInfoNode.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGameInfo
 ISgfcGameInfo ()
 Initializes a newly constructed ISgfcGameInfo object.
 
virtual ~ISgfcGameInfo ()
 Destroys and cleans up the ISgfcGameInfo object.
 

Protected Member Functions

SgfcNumber GetNumberPropertyValue (std::shared_ptr< ISgfcProperty > property) const
 
SgfcReal GetRealPropertyValue (std::shared_ptr< ISgfcProperty > property) const
 
SgfcSimpleText GetSimpleTextPropertyValue (std::shared_ptr< ISgfcProperty > property) const
 
SgfcText GetTextPropertyValue (std::shared_ptr< ISgfcProperty > property) const
 
void RemovePropertyFromNodeIfExists (SgfcPropertyType propertyType, std::shared_ptr< ISgfcNode > node) const
 

Detailed Description

The SgfcGameInfo class provides an implementation of the ISgfcGameInfo interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcGameInfo() [1/2]

LibSgfcPlusPlus::SgfcGameInfo::SgfcGameInfo ( std::shared_ptr< ISgfcNode > rootNode)

Initializes a newly constructed SgfcGameInfo object with values taken from the properties in root node rootNode. All values that would normally be taken from the properties in the game info node have default values.

Exceptions
std::invalid_argumentIs thrown if rootNode is nullptr.

◆ SgfcGameInfo() [2/2]

LibSgfcPlusPlus::SgfcGameInfo::SgfcGameInfo ( std::shared_ptr< ISgfcNode > rootNode,
std::shared_ptr< ISgfcNode > gameInfoNode )

Initializes a newly constructed SgfcGameInfo object with values taken from the properties in root node rootNode and from game info node gameInfoNode.

Exceptions
std::invalid_argumentIs thrown if rootNode is nullptr or if gameInfoNode is nullptr.

Member Function Documentation

◆ GetAnnotationAuthor()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetAnnotationAuthor ( ) const
overridevirtual

Returns the name of the person who made the annotations to the game. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::AN

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetBlackPlayerName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetBlackPlayerName ( ) const
overridevirtual

Returns the name of the black player. The default value is an empty string.

See also
SgfcPropertyType::PB

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetBlackPlayerRank()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetBlackPlayerRank ( ) const
overridevirtual

Returns the rank of the black player. The default value is an empty string.

See also
SgfcPropertyType::BR

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetBlackPlayerTeamName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetBlackPlayerTeamName ( ) const
overridevirtual

Returns the name of the black player's team. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::BT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetBoardSize()

SgfcBoardSize LibSgfcPlusPlus::SgfcGameInfo::GetBoardSize ( ) const
overridevirtual

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.

See also
SgfcPropertyType::SZ

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetCopyrightInformation()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetCopyrightInformation ( ) const
overridevirtual

Returns the copyright information for the game data (including the annotations). The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::CP

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetEventName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetEventName ( ) const
overridevirtual

Returns the name of the event (e.g. tournament) where the game was played. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::EV

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameDates()

std::vector< SgfcDate > LibSgfcPlusPlus::SgfcGameInfo::GetGameDates ( ) const
overridevirtual

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.

See also
SgfcPropertyType::DT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameInformation()

SgfcText LibSgfcPlusPlus::SgfcGameInfo::GetGameInformation ( ) const
overridevirtual

Returns information about the game (e.g. background information, a game summary, etc.). The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::GC

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameLocation()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetGameLocation ( ) const
overridevirtual

Returns the name or description of the location where the game was played. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::PC

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetGameName ( ) const
overridevirtual

Returns the name of the game (e.g. for easily finding the game again within a collection). The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::GN

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameResult()

SgfcGameResult LibSgfcPlusPlus::SgfcGameInfo::GetGameResult ( ) const
overridevirtual

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.

See also
SgfcPropertyType::RE

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameType()

SgfcGameType LibSgfcPlusPlus::SgfcGameInfo::GetGameType ( ) const
overridevirtual

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.

See also
SgfcPropertyType::GM

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetGameTypeAsNumber()

SgfcNumber LibSgfcPlusPlus::SgfcGameInfo::GetGameTypeAsNumber ( )
overridevirtual

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.

See also
SgfcPropertyType::GM

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetOpeningInformation()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetOpeningInformation ( ) const
overridevirtual

Returns information about the opening played. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::ON

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetOvertimeInformation()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetOvertimeInformation ( ) const
overridevirtual

Returns the description of the method used for overtime (byo-yomi). The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::OT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRawGameDates()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetRawGameDates ( ) const
overridevirtual

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.

Note
There is no setter for the raw game dates value because the SGF standard requires a certain format in the raw property value, and that can be guaranteed only by forcing the library client to set the game dates via structured SgfcDate values.
See also
SgfcPropertyType::DT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRawGameResult()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetRawGameResult ( ) const
overridevirtual

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.

Note
There is no setter for the raw game result value because the SGF standard requires a certain format in the raw property value, and that can be guaranteed only by forcing the library client to set the game result via a structured SgfcGameResult value.
See also
SgfcPropertyType::RE

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRawRoundInformation()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetRawRoundInformation ( ) const
overridevirtual

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.

Note
There is no setter for the raw round information value because the SGF standard requires a certain format in the raw property value, and that can be guaranteed only by forcing the library client to set the round information via a structured SgfcRoundInformation value.
See also
SgfcPropertyType::RO

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRecorderName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetRecorderName ( ) const
overridevirtual

Returns the name of the user (or program) who recorded or entered the game data. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::US

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRoundInformation()

SgfcRoundInformation LibSgfcPlusPlus::SgfcGameInfo::GetRoundInformation ( ) const
overridevirtual

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.

See also
SgfcPropertyType::RO

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetRulesName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetRulesName ( ) const
overridevirtual

Returns the name of the rules used for the game. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::RU

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetSourceName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetSourceName ( ) const
overridevirtual

Returns the name of the source of the game data (e.g. book, journal, etc.). The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::SO

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetTimeLimitInSeconds()

SgfcReal LibSgfcPlusPlus::SgfcGameInfo::GetTimeLimitInSeconds ( ) const
overridevirtual

Returns the time limit of the game in seconds. The default value is 0.0.

See also
SgfcPropertyType::TM

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetWhitePlayerName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetWhitePlayerName ( ) const
overridevirtual

Returns the name of the white player. The default value is an empty string.

See also
SgfcPropertyType::PW

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetWhitePlayerRank()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetWhitePlayerRank ( ) const
overridevirtual

Returns the rank of the white player. The default value is an empty string.

See also
SgfcPropertyType::WR

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ GetWhitePlayerTeamName()

SgfcSimpleText LibSgfcPlusPlus::SgfcGameInfo::GetWhitePlayerTeamName ( ) const
overridevirtual

Returns the name of the white player's team. The default value is SgfcConstants::NoneValueString.

See also
SgfcPropertyType::WT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetAnnotationAuthor()

void LibSgfcPlusPlus::SgfcGameInfo::SetAnnotationAuthor ( const SgfcSimpleText & annotationAuthor)
overridevirtual

Sets the name of the person who made the annotations to the game.

See also
SgfcPropertyType::AN

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetBlackPlayerName()

void LibSgfcPlusPlus::SgfcGameInfo::SetBlackPlayerName ( const SgfcSimpleText & blackPlayerName)
overridevirtual

Sets the name of the black player.

See also
SgfcPropertyType::PB

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetBlackPlayerRank()

void LibSgfcPlusPlus::SgfcGameInfo::SetBlackPlayerRank ( const SgfcSimpleText & blackPlayerRank)
overridevirtual

Sets the rank of the black player.

See also
SgfcPropertyType::BR

Implements LibSgfcPlusPlus::ISgfcGameInfo.

Reimplemented in LibSgfcPlusPlus::SgfcGoGameInfo.

◆ SetBlackPlayerTeamName()

void LibSgfcPlusPlus::SgfcGameInfo::SetBlackPlayerTeamName ( const SgfcSimpleText & blackPlayerTeamName)
overridevirtual

Sets the name of the black player's team.

See also
SgfcPropertyType::BT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetCopyrightInformation()

void LibSgfcPlusPlus::SgfcGameInfo::SetCopyrightInformation ( const SgfcSimpleText & copyrightInformation)
overridevirtual

Sets the copyright information for the game data (including the annotations).

See also
SgfcPropertyType::CP

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetEventName()

void LibSgfcPlusPlus::SgfcGameInfo::SetEventName ( const SgfcSimpleText & eventName)
overridevirtual

Sets the name of the event (e.g. tournament) where the game was played.

See also
SgfcPropertyType::EV

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetGameDates()

void LibSgfcPlusPlus::SgfcGameInfo::SetGameDates ( const std::vector< SgfcDate > & gameDates)
overridevirtual

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().

See also
SgfcPropertyType::DT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetGameInformation()

void LibSgfcPlusPlus::SgfcGameInfo::SetGameInformation ( const SgfcText & gameInformation)
overridevirtual

Sets information about the game (e.g. background information, a game summary, etc.).

See also
SgfcPropertyType::GC

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetGameLocation()

void LibSgfcPlusPlus::SgfcGameInfo::SetGameLocation ( const SgfcSimpleText & gameLocation)
overridevirtual

Sets the name or description of the location where the game was played.

See also
SgfcPropertyType::PC

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetGameName()

void LibSgfcPlusPlus::SgfcGameInfo::SetGameName ( const SgfcSimpleText & gameName)
overridevirtual

Sets the name of the game (e.g. for easily finding the game again within a collection).

See also
SgfcPropertyType::GN

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetGameResult()

void LibSgfcPlusPlus::SgfcGameInfo::SetGameResult ( SgfcGameResult gameResult)
overridevirtual

Sets the result of the game, decomposed into an outcome and an optional score.

Invoking this setter also changes the information returned by GetRawGameResult().

See also
SgfcPropertyType::RE

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetOpeningInformation()

void LibSgfcPlusPlus::SgfcGameInfo::SetOpeningInformation ( const SgfcSimpleText & openingInformation)
overridevirtual

Sets the information about the opening played.

See also
SgfcPropertyType::ON

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetOvertimeInformation()

void LibSgfcPlusPlus::SgfcGameInfo::SetOvertimeInformation ( const SgfcSimpleText & overtimeInformation)
overridevirtual

Sets the description of the method used for overtime (byo-yomi).

See also
SgfcPropertyType::OT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetRecorderName()

void LibSgfcPlusPlus::SgfcGameInfo::SetRecorderName ( const SgfcSimpleText & recorderName)
overridevirtual

Sets the name of the user (or program) who recorded or entered the game data.

See also
SgfcPropertyType::US

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetRoundInformation()

void LibSgfcPlusPlus::SgfcGameInfo::SetRoundInformation ( const SgfcRoundInformation & roundInformation)
overridevirtual

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().

See also
SgfcPropertyType::RO

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetRulesName()

void LibSgfcPlusPlus::SgfcGameInfo::SetRulesName ( const SgfcSimpleText & rulesName)
overridevirtual

Sets the name of the rules used for the game.

See also
SgfcPropertyType::RU

Implements LibSgfcPlusPlus::ISgfcGameInfo.

Reimplemented in LibSgfcPlusPlus::SgfcGoGameInfo.

◆ SetSourceName()

void LibSgfcPlusPlus::SgfcGameInfo::SetSourceName ( const SgfcSimpleText & sourceName)
overridevirtual

Sets the name of the source of the game data (e.g. book, journal, etc.).

See also
SgfcPropertyType::SO

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetTimeLimitInSeconds()

void LibSgfcPlusPlus::SgfcGameInfo::SetTimeLimitInSeconds ( SgfcReal timeLimitInSeconds)
overridevirtual

Sets the time limit of the game in seconds.

See also
SgfcPropertyType::TM

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetWhitePlayerName()

void LibSgfcPlusPlus::SgfcGameInfo::SetWhitePlayerName ( const SgfcSimpleText & whitePlayerName)
overridevirtual

Sets the name of the white player.

See also
SgfcPropertyType::PW

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ SetWhitePlayerRank()

void LibSgfcPlusPlus::SgfcGameInfo::SetWhitePlayerRank ( const SgfcSimpleText & whitePlayerRank)
overridevirtual

Sets the rank of the white player.

See also
SgfcPropertyType::WR

Implements LibSgfcPlusPlus::ISgfcGameInfo.

Reimplemented in LibSgfcPlusPlus::SgfcGoGameInfo.

◆ SetWhitePlayerTeamName()

void LibSgfcPlusPlus::SgfcGameInfo::SetWhitePlayerTeamName ( const SgfcSimpleText & whitePlayerTeamName)
overridevirtual

Sets the name of the white player's team.

See also
SgfcPropertyType::WT

Implements LibSgfcPlusPlus::ISgfcGameInfo.

◆ ToGoGameInfo()

const ISgfcGoGameInfo * LibSgfcPlusPlus::SgfcGameInfo::ToGoGameInfo ( ) const
overridevirtual

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.

Implements LibSgfcPlusPlus::ISgfcGameInfo.

Reimplemented in LibSgfcPlusPlus::SgfcGoGameInfo.

◆ WriteToGameInfoNode()

void LibSgfcPlusPlus::SgfcGameInfo::WriteToGameInfoNode ( std::shared_ptr< ISgfcNode > gameInfoNode)
virtual

Writes all game info property values in the ISgfcGameInfo object to the corresponding properties in gameInfoNode.

If the property value to be written is equal to the property's default value then the property is removed from gameInfoNode if it exists, or not written if it does not exist.

If the property value to be written is not equal to the property's default value then the property value is written to gameInfoNode, either creating the property if it does not exist or overwriting its value if it does exist.

Exceptions
std::invalid_argumentIs thrown if gameInfoNode is nullptr.

Reimplemented in LibSgfcPlusPlus::SgfcGoGameInfo.

◆ WriteToRootNode()

void LibSgfcPlusPlus::SgfcGameInfo::WriteToRootNode ( std::shared_ptr< ISgfcNode > rootNode)
virtual

Writes all root property values in the ISgfcGameInfo object to the corresponding properties in rootNode.

If rootNode already contains a property, the property's value is overwritten. If rootNode does not contain a property, the property is created.

Exceptions
std::invalid_argumentIs thrown if rootNode is nullptr.

The documentation for this class was generated from the following files: