Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
piece_type.cpp File Reference
#include "piece_type.h"
#include <cassert>
#include <iostream>
#include <sstream>
Include dependency graph for piece_type.cpp:

Functions

std::vector< piece_typeget_all_piece_types () noexcept
 Get all the piece types.
 
int get_piece_value (const piece_type type)
 Get the value of the pieces.
 
void test_piece_type ()
 Test this class and its free functions.
 
piece_type to_piece_type (const char c)
 Convert the PGN notation of a piece to its type, e.g.
 
std::string to_str (const piece_type type) noexcept
 Convert a piece_type to a string.
 
std::ostream & operator<< (std::ostream &os, const piece_type type) noexcept
 

Function Documentation

◆ get_all_piece_types()

std::vector< piece_type > get_all_piece_types ( )
noexcept

Get all the piece types.

◆ get_piece_value()

int get_piece_value ( const piece_type  type)

Get the value of the pieces.

A king has a value of zero, although in practice its value is infinite

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const piece_type  type 
)
noexcept

◆ test_piece_type()

void test_piece_type ( )

Test this class and its free functions.

◆ to_piece_type()

piece_type to_piece_type ( const char  c)

Convert the PGN notation of a piece to its type, e.g.

'N' becomes a knight

◆ to_str()

std::string to_str ( const piece_type  type)
noexcept

Convert a piece_type to a string.