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

The SgfcGoMove class provides an implementation of the ISgfcGoMove interface. See the interface header file for documentation. More...

#include <SgfcGoMove.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcGoMove:
LibSgfcPlusPlus::ISgfcGoMove

Public Member Functions

 SgfcGoMove (std::shared_ptr< ISgfcGoStone > stone)
 Initializes a newly constructed SgfcGoMove object. The move is not a pass move. stone indicates the color and location of the stone that was placed by the move on the board.
 
 SgfcGoMove (SgfcColor playerColor)
 Initializes a newly constructed SgfcGoMove object. The move is a pass move. playerColor indicates the color of the player who made the move.
 
virtual ~SgfcGoMove ()
 Destroys and cleans up the SgfcGoMove object.
 
virtual bool IsPassMove () const override
 Returns true if the move is a pass move. Returns false if the move is not a pass move.
 
virtual std::shared_ptr< ISgfcGoStoneGetStone () const override
 Returns the stone that was placed on the Go board by the move. Returns nullptr if IsPassMove() returns true.
 
virtual SgfcColor GetPlayerColor () const override
 Returns the color of the player who made the move.
 
virtual std::shared_ptr< ISgfcGoPointGetStoneLocation () const override
 Returns the location of the stone that was placed by the move on the Go board. Returns nullptr if IsPassMove() returns true.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGoMove
 ISgfcGoMove ()
 Initializes a newly constructed ISgfcGoMove object.
 
virtual ~ISgfcGoMove ()
 Destroys and cleans up the ISgfcGoMove object.
 

Detailed Description

The SgfcGoMove class provides an implementation of the ISgfcGoMove interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcGoMove()

LibSgfcPlusPlus::SgfcGoMove::SgfcGoMove ( std::shared_ptr< ISgfcGoStone > stone)

Initializes a newly constructed SgfcGoMove object. The move is not a pass move. stone indicates the color and location of the stone that was placed by the move on the board.

Exceptions
std::invalid_argumentIs thrown if stone is nullptr.

Member Function Documentation

◆ GetPlayerColor()

SgfcColor LibSgfcPlusPlus::SgfcGoMove::GetPlayerColor ( ) const
overridevirtual

Returns the color of the player who made the move.

If IsPassMove() returns false, this method returns the same value as the ISgfcGoStone::GetColor() method of the ISgfcGoStone object returned by GetStone().

Implements LibSgfcPlusPlus::ISgfcGoMove.

◆ GetStone()

std::shared_ptr< ISgfcGoStone > LibSgfcPlusPlus::SgfcGoMove::GetStone ( ) const
overridevirtual

Returns the stone that was placed on the Go board by the move. Returns nullptr if IsPassMove() returns true.

Implements LibSgfcPlusPlus::ISgfcGoMove.

◆ GetStoneLocation()

std::shared_ptr< ISgfcGoPoint > LibSgfcPlusPlus::SgfcGoMove::GetStoneLocation ( ) const
overridevirtual

Returns the location of the stone that was placed by the move on the Go board. Returns nullptr if IsPassMove() returns true.

This is a convenience method that returns the same value as the ISgfcGoStone::GetLocation() method of the ISgfcGoStone object returned by GetStone().

Implements LibSgfcPlusPlus::ISgfcGoMove.

◆ IsPassMove()

bool LibSgfcPlusPlus::SgfcGoMove::IsPassMove ( ) const
overridevirtual

Returns true if the move is a pass move. Returns false if the move is not a pass move.

Implements LibSgfcPlusPlus::ISgfcGoMove.


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