-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfd4f5
commit fef0ef1
Showing
18 changed files
with
119 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
#include "board.hxx" | ||
|
||
namespace chess { | ||
Board::Board() { | ||
for (auto* sq : _board) { | ||
sq = nullptr; | ||
} | ||
} | ||
} // namespace chess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "move.hxx" | ||
|
||
#include <utility> | ||
|
||
#include "constants.hxx" | ||
|
||
namespace chess { | ||
Move::Move() { | ||
_ply[constants::color::black] = nullptr; | ||
_ply[constants::color::white] = nullptr; | ||
} | ||
|
||
Move::Move(Ply& ply_black, Ply& ply_white) { | ||
ply(constants::color::black, ply_black); | ||
ply(constants::color::white, ply_white); | ||
} | ||
|
||
void Move::ply(constants::color color, Ply& ply) { _ply[color] = &ply; } | ||
|
||
Ply& Move::ply(constants::color color) { return *_ply[color]; } | ||
} // namespace chess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#include "piece.hxx" | ||
|
||
namespace chess { | ||
Piece::Piece(piece::piece type, color::color color) { | ||
Piece::Piece(constants::piece type, constants::color color) { | ||
_type = type; | ||
_color = color; | ||
} | ||
|
||
piece::piece Piece::get_type() { return _type; } | ||
constants::piece Piece::type() { return _type; } | ||
|
||
color::color Piece::get_color() { return _color; } | ||
constants::color Piece::color() { return _color; } | ||
} // namespace chess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "ply.hxx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef CHESSPP_PLY_HXX | ||
#define CHESSPP_PLY_HXX | ||
|
||
#include "constants.hxx" | ||
|
||
namespace chess { | ||
class Ply { | ||
constants::color _color; | ||
constants::piece _piece_type; | ||
constants::square _from; | ||
constants::square _to; | ||
}; | ||
} // namespace chess | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#include "square.hxx" | ||
|
||
namespace chess { | ||
Square::Square(square::square square) { | ||
Square::Square(constants::square square) { | ||
_name = square; | ||
_piece = nullptr; | ||
} | ||
|
||
Square::Square(square::square square, Piece &piece) { | ||
Square::Square(constants::square square, Piece& piece) { | ||
_name = square; | ||
set_piece(piece); | ||
this->piece(piece); | ||
} | ||
|
||
square::square Square::name() { return _name; } | ||
constants::square Square::name() { return _name; } | ||
|
||
file::file Square::file() { return file::file(_name % 8); } | ||
constants::file Square::file() { return constants::file(_name % 8); } | ||
|
||
rank::rank Square::rank() { return rank::rank(_name / 8); } | ||
constants::rank Square::rank() { return constants::rank(_name / 8); } | ||
|
||
Piece &Square::get_piece() { return *_piece; } | ||
Piece& Square::piece() { return *_piece; } | ||
|
||
void Square::set_piece(Piece &piece) { _piece = &piece; } | ||
void Square::piece(Piece& piece) { _piece = &piece; } | ||
} // namespace chess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters