implemented some stuff
This commit is contained in:
parent
585e392b6a
commit
29453fbb14
2
.gitignore
vendored
2
.gitignore
vendored
@ -171,4 +171,4 @@ cython_debug/
|
||||
.ruff_cache/
|
||||
|
||||
# PyPI configuration file
|
||||
.pypirc
|
||||
.pypirc
|
||||
|
@ -1,14 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "piece.hpp"
|
||||
#include "pieces/piece.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
enum CastleRights : int8_t {
|
||||
KingSide = 1,
|
||||
QueenSide = 2,
|
||||
};
|
||||
|
||||
class Board {
|
||||
private:
|
||||
int8_t squares[64] = {Piece::None};
|
||||
|
7
cpp/src/castle_side.hpp
Normal file
7
cpp/src/castle_side.hpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include <cstdint>
|
||||
|
||||
enum class CastleSide : int8_t {
|
||||
Neither = 0,
|
||||
King = 1,
|
||||
Queen = 2,
|
||||
};
|
@ -1,6 +1,11 @@
|
||||
#include "castle_side.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct Move {
|
||||
int8_t start_square;
|
||||
int8_t piece;
|
||||
int8_t target_square;
|
||||
|
||||
bool is_capturing = false;
|
||||
CastleSide castle_side = CastleSide::Neither;
|
||||
};
|
||||
|
19
cpp/src/pieces/piece.cpp
Normal file
19
cpp/src/pieces/piece.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "piece.hpp"
|
||||
|
||||
#include "../board.hpp"
|
||||
|
||||
std::vector<Move> pawn_moves(Board b) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<Move> legal_moves(Piece p, Board b) {
|
||||
switch (p) {
|
||||
case Piece::Pawn:
|
||||
return pawn_moves(b);
|
||||
case Piece::Bishop:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return {};
|
||||
}
|
@ -1,4 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "../move.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
enum Piece : int8_t {
|
||||
None = 0,
|
||||
@ -14,3 +19,6 @@ enum Colour : int8_t {
|
||||
White = 8,
|
||||
Black = 16,
|
||||
};
|
||||
|
||||
class Board;
|
||||
std::vector<Move> legal_moves(Piece p, Board b);
|
Loading…
x
Reference in New Issue
Block a user