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 | List of all members
LibSgfcPlusPlus::SgfcGoGameInfo Class Reference

The SgfcGoGameInfo class provides an implementation of the ISgfcGoGameInfo interface. See the interface header file for documentation. More...

#include <SgfcGoGameInfo.h>

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

Public Member Functions

 SgfcGoGameInfo ()
 Initializes a newly constructed SgfcGoGameInfo object.
 
 SgfcGoGameInfo (std::shared_ptr< ISgfcNode > rootNode)
 Initializes a newly constructed SgfcGoGameInfo 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.
 
 SgfcGoGameInfo (std::shared_ptr< ISgfcNode > rootNode, std::shared_ptr< ISgfcNode > gameInfoNode)
 Initializes a newly constructed SgfcGoGameInfo object with values taken from the properties in root node rootNode and from game info node gameInfoNode.
 
virtual ~SgfcGoGameInfo ()
 Destroys and cleans up the SgfcGoGameInfo object.
 
virtual SgfcNumber GetNumberOfHandicapStones () const override
 Returns the number of handicap stones. The default value is SgfcConstants::HandicapStonesNone.
 
virtual void SetNumberOfHandicapStones (SgfcNumber numberOfHandicapStones) override
 Sets the number of handicap stones.
 
virtual SgfcReal GetKomi () const override
 Returns the komi. The default value is SgfcConstants::KomiNone.
 
virtual void SetKomi (SgfcReal komi) override
 Sets the komi.
 
virtual SgfcGoRuleset GetGoRuleset () const override
 Returns the Go ruleset used for the game. The default value is an SgfcGoRuleset object which has the IsValid property set to false.
 
virtual void SetGoRuleset (SgfcGoRuleset goRuleset) override
 Sets the Go ruleset used for the game.
 
virtual void SetRulesName (const SgfcSimpleText &rulesName) override
 Sets the name of the rules used for the game.
 
virtual SgfcGoPlayerRank GetGoBlackPlayerRank () const override
 Returns the rank of the black player. The default value is an SgfcGoPlayerRank object which has the IsValid property set to false.
 
virtual void SetGoBlackPlayerRank (SgfcGoPlayerRank goBlackPlayerRank) override
 Sets the rank of the black player.
 
virtual void SetBlackPlayerRank (const SgfcSimpleText &blackPlayerRank) override
 Sets the rank of the black player.
 
virtual SgfcGoPlayerRank GetGoWhitePlayerRank () const override
 Returns the rank of the white player. The default value is an SgfcGoPlayerRank object which has the IsValid property set to false.
 
virtual void SetGoWhitePlayerRank (SgfcGoPlayerRank goWhitePlayerRank) override
 Sets the rank of the white player.
 
virtual void SetWhitePlayerRank (const SgfcSimpleText &whitePlayerRank) override
 Sets the rank of the white player.
 
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 WriteToGameInfoNode (std::shared_ptr< ISgfcNode > gameInfoNode) override
 Writes all game info property values in the ISgfcGameInfo object to the corresponding properties in gameInfoNode.
 
- Public Member Functions inherited from LibSgfcPlusPlus::SgfcGameInfo
 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 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 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 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 void WriteToRootNode (std::shared_ptr< ISgfcNode > rootNode)
 Writes all root property values in the ISgfcGameInfo object to the corresponding properties in rootNode.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGameInfo
 ISgfcGameInfo ()
 Initializes a newly constructed ISgfcGameInfo object.
 
virtual ~ISgfcGameInfo ()
 Destroys and cleans up the ISgfcGameInfo object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGoGameInfo
 ISgfcGoGameInfo ()
 Initializes a newly constructed ISgfcGoGameInfo object.
 
virtual ~ISgfcGoGameInfo ()
 Destroys and cleans up the ISgfcGoGameInfo object.
 

Additional Inherited Members

- Protected Member Functions inherited from LibSgfcPlusPlus::SgfcGameInfo
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 SgfcGoGameInfo class provides an implementation of the ISgfcGoGameInfo interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcGoGameInfo() [1/2]

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

Initializes a newly constructed SgfcGoGameInfo 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.

◆ SgfcGoGameInfo() [2/2]

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

Initializes a newly constructed SgfcGoGameInfo 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

◆ GetGoBlackPlayerRank()

SgfcGoPlayerRank LibSgfcPlusPlus::SgfcGoGameInfo::GetGoBlackPlayerRank ( ) const
overridevirtual

Returns the rank of the black player. The default value is an SgfcGoPlayerRank object which has the IsValid property set to false.

The returned SgfcGoPlayerRank also has the IsValid property set to false if there is a problem with decomposing the raw property value. See SgfcGoPlayerRank::FromPropertyValue() for details. An indicator that this happened is if GetBlackPlayerRank() returns a value that is not equal to SgfcConstants::NoneValueString.

Invoking the base class method SetBlackPlayerRank() also changes the information returned by this method.

See also
SgfcPropertyType::BR

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ GetGoRuleset()

SgfcGoRuleset LibSgfcPlusPlus::SgfcGoGameInfo::GetGoRuleset ( ) const
overridevirtual

Returns the Go ruleset used for the game. The default value is an SgfcGoRuleset object which has the IsValid property set to false.

The returned SgfcGoRuleset also has the IsValid property set to false if there is a problem with decomposing the raw property value. See SgfcGoRuleset::FromPropertyValue() for details. An indicator that this happened is if GetRulesName() returns a value that is not equal to SgfcConstants::NoneValueString.

Invoking the base class method SetRulesName() also changes the information returned by this method.

See also
SgfcPropertyType::RU

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ GetGoWhitePlayerRank()

SgfcGoPlayerRank LibSgfcPlusPlus::SgfcGoGameInfo::GetGoWhitePlayerRank ( ) const
overridevirtual

Returns the rank of the white player. The default value is an SgfcGoPlayerRank object which has the IsValid property set to false.

The returned SgfcGoPlayerRank also has the IsValid property set to false if there is a problem with decomposing the raw property value. See SgfcGoPlayerRank::FromPropertyValue() for details. An indicator that this happened is if GetWhitePlayerRank() returns a value that is not equal to SgfcConstants::NoneValueString.

Invoking the base class method SetWhitePlayerRank() also changes the information returned by this method.

See also
SgfcPropertyType::WR

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ GetKomi()

SgfcReal LibSgfcPlusPlus::SgfcGoGameInfo::GetKomi ( ) const
overridevirtual

Returns the komi. The default value is SgfcConstants::KomiNone.

See also
SgfcPropertyType::KM

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ GetNumberOfHandicapStones()

SgfcNumber LibSgfcPlusPlus::SgfcGoGameInfo::GetNumberOfHandicapStones ( ) const
overridevirtual

Returns the number of handicap stones. The default value is SgfcConstants::HandicapStonesNone.

See also
SgfcPropertyType::HA

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetBlackPlayerRank()

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

Sets the rank of the black player.

See also
SgfcPropertyType::BR

Reimplemented from LibSgfcPlusPlus::SgfcGameInfo.

◆ SetGoBlackPlayerRank()

void LibSgfcPlusPlus::SgfcGoGameInfo::SetGoBlackPlayerRank ( SgfcGoPlayerRank goBlackPlayerRank)
overridevirtual

Sets the rank of the black player.

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

See also
SgfcPropertyType::BR

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetGoRuleset()

void LibSgfcPlusPlus::SgfcGoGameInfo::SetGoRuleset ( SgfcGoRuleset goRuleset)
overridevirtual

Sets the Go ruleset used for the game.

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

See also
SgfcPropertyType::RU

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetGoWhitePlayerRank()

void LibSgfcPlusPlus::SgfcGoGameInfo::SetGoWhitePlayerRank ( SgfcGoPlayerRank goWhitePlayerRank)
overridevirtual

Sets the rank of the white player.

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

See also
SgfcPropertyType::WR

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetKomi()

void LibSgfcPlusPlus::SgfcGoGameInfo::SetKomi ( SgfcReal komi)
overridevirtual

Sets the komi.

See also
SgfcPropertyType::KM

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetNumberOfHandicapStones()

void LibSgfcPlusPlus::SgfcGoGameInfo::SetNumberOfHandicapStones ( SgfcNumber numberOfHandicapStones)
overridevirtual

Sets the number of handicap stones.

See also
SgfcPropertyType::HA

Implements LibSgfcPlusPlus::ISgfcGoGameInfo.

◆ SetRulesName()

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

Sets the name of the rules used for the game.

See also
SgfcPropertyType::RU

Reimplemented from LibSgfcPlusPlus::SgfcGameInfo.

◆ SetWhitePlayerRank()

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

Sets the rank of the white player.

See also
SgfcPropertyType::WR

Reimplemented from LibSgfcPlusPlus::SgfcGameInfo.

◆ ToGoGameInfo()

const ISgfcGoGameInfo * LibSgfcPlusPlus::SgfcGoGameInfo::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.

Reimplemented from LibSgfcPlusPlus::SgfcGameInfo.

◆ WriteToGameInfoNode()

void LibSgfcPlusPlus::SgfcGoGameInfo::WriteToGameInfoNode ( std::shared_ptr< ISgfcNode > gameInfoNode)
overridevirtual

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 from LibSgfcPlusPlus::SgfcGameInfo.


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