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::SgfcGoPoint Class Reference

The SgfcGoPoint class provides an implementation of the ISgfcGoPoint interface. See the interface header file for documentation. More...

#include <SgfcGoPoint.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcGoPoint:
LibSgfcPlusPlus::ISgfcGoPoint

Public Member Functions

 SgfcGoPoint (const SgfcPoint &pointValue, SgfcBoardSize boardSize)
 Initializes a newly constructed SgfcGoPoint object. The object refers to the point specified by pointValue. boardSize indicates the size of the Go board that the Go point is located on.
 
virtual ~SgfcGoPoint ()
 Destroys and cleans up the SgfcGoPoint object.
 
virtual unsigned int GetXPosition (SgfcCoordinateSystem coordinateSystem) const override
 Returns the 1-based numeric x-axis position of the point in the desired coordinate system coordinateSystem.
 
virtual unsigned int GetYPosition (SgfcCoordinateSystem coordinateSystem) const override
 Returns the 1-based numeric y-axis position of the point in the desired coordinate system coordinateSystem.
 
virtual bool HasPosition (SgfcGoPointNotation goPointNotation) const override
 Returns true if GetPosition(), GetXPosition() and GetYPosition() return a non-empty string for the desired notation goPointNotation. Returns false if these methods return an empty string.
 
virtual std::string GetPosition (SgfcGoPointNotation goPointNotation) const override
 Returns the position of the point as a single string value in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.
 
virtual std::string GetXPosition (SgfcGoPointNotation goPointNotation) const override
 Returns the x-axis compound of the point's position in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.
 
virtual std::string GetYPosition (SgfcGoPointNotation goPointNotation) const override
 Returns the y-axis compound of the point's position in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGoPoint
 ISgfcGoPoint ()
 Initializes a newly constructed ISgfcGoPoint object.
 
virtual ~ISgfcGoPoint ()
 Destroys and cleans up the ISgfcGoPoint object.
 

Detailed Description

The SgfcGoPoint class provides an implementation of the ISgfcGoPoint interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcGoPoint()

LibSgfcPlusPlus::SgfcGoPoint::SgfcGoPoint ( const SgfcPoint & pointValue,
SgfcBoardSize boardSize )

Initializes a newly constructed SgfcGoPoint object. The object refers to the point specified by pointValue. boardSize indicates the size of the Go board that the Go point is located on.

pointValue can be given in any one of the notations enumerated in SgfcGoPointNotation.

Exceptions
std::invalid_argumentIs thrown if boardSize refers to a board with size smaller than the minimum required by the SGF standard (SgfcConstants::BoardSizeMinimum), or a board with size larger than the maximum allowed by the SGF standard (SgfcConstants::BoardSizeMaximumGo). Is also thrown if pointValue is not given in one of the notations enumerated in SgfcGoPointNotation, or if pointValue violates one of the restrictions imposed by the used notation (e.g. y-axis compound larger than 25 when SgfcGoPointNotation::Hybrid is used), or if pointValue refers to an invalid location on the board (e.g. an x-axis or y-axis location that exceeds the board size specified by boardSize, or a compound < 1 when SgfcGoPointNotation::Figure is used).

Member Function Documentation

◆ GetPosition()

std::string LibSgfcPlusPlus::SgfcGoPoint::GetPosition ( SgfcGoPointNotation goPointNotation) const
overridevirtual

Returns the position of the point as a single string value in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.

Implements LibSgfcPlusPlus::ISgfcGoPoint.

◆ GetXPosition() [1/2]

unsigned int LibSgfcPlusPlus::SgfcGoPoint::GetXPosition ( SgfcCoordinateSystem coordinateSystem) const
overridevirtual

Returns the 1-based numeric x-axis position of the point in the desired coordinate system coordinateSystem.

Implements LibSgfcPlusPlus::ISgfcGoPoint.

◆ GetXPosition() [2/2]

std::string LibSgfcPlusPlus::SgfcGoPoint::GetXPosition ( SgfcGoPointNotation goPointNotation) const
overridevirtual

Returns the x-axis compound of the point's position in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.

Implements LibSgfcPlusPlus::ISgfcGoPoint.

◆ GetYPosition() [1/2]

unsigned int LibSgfcPlusPlus::SgfcGoPoint::GetYPosition ( SgfcCoordinateSystem coordinateSystem) const
overridevirtual

Returns the 1-based numeric y-axis position of the point in the desired coordinate system coordinateSystem.

Implements LibSgfcPlusPlus::ISgfcGoPoint.

◆ GetYPosition() [2/2]

std::string LibSgfcPlusPlus::SgfcGoPoint::GetYPosition ( SgfcGoPointNotation goPointNotation) const
overridevirtual

Returns the y-axis compound of the point's position in the desired notation goPointNotation. Returns an empty string if HasPosition() returns false for goPointNotation.

Implements LibSgfcPlusPlus::ISgfcGoPoint.

◆ HasPosition()

bool LibSgfcPlusPlus::SgfcGoPoint::HasPosition ( SgfcGoPointNotation goPointNotation) const
overridevirtual

Returns true if GetPosition(), GetXPosition() and GetYPosition() return a non-empty string for the desired notation goPointNotation. Returns false if these methods return an empty string.

The methods may return an empty string if the desired notation cannot represent the point location. See the documentation of each SgfcGoPointNotation enum value for a definition of the notation and its limitations. Notably, the "A1" hybrid notation cannot represent point locations with an x- or y-axis position greater than 25.

Implements LibSgfcPlusPlus::ISgfcGoPoint.


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