[core] Rename (once again) chess_core → chessfriend_core
This commit is contained in:
parent
625bfb2446
commit
b0b22048a8
21 changed files with 30 additions and 30 deletions
|
@ -3,6 +3,6 @@
|
||||||
members = [
|
members = [
|
||||||
"board",
|
"board",
|
||||||
"chess_bitboard",
|
"chess_bitboard",
|
||||||
"chess_core",
|
"chessfriend_core",
|
||||||
"explorer",
|
"explorer",
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,4 +6,4 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
core = { path = "../core" }
|
chessfriend_core = { path = "../core" }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crate::library::{library, FILES, RANKS};
|
use crate::library::{library, FILES, RANKS};
|
||||||
use crate::LeadingBitScanner;
|
use crate::LeadingBitScanner;
|
||||||
use chess_core::{Direction, Square};
|
use chessfriend_core::{Direction, Square};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::ops::Not;
|
use std::ops::Not;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub(crate) use bitboard::{BitBoard, BitBoardBuilder};
|
||||||
macro_rules! bitboard {
|
macro_rules! bitboard {
|
||||||
($($sq:ident),* $(,)?) => {
|
($($sq:ident),* $(,)?) => {
|
||||||
$crate::bitboard::BitBoardBuilder::empty()
|
$crate::bitboard::BitBoardBuilder::empty()
|
||||||
$(.square(chess_core::Square::$sq))*
|
$(.square(chessfriend_core::Square::$sq))*
|
||||||
.build()
|
.build()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Eryn Wells <eryn@erynwells.me>
|
// Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
use super::BitBoard;
|
use super::BitBoard;
|
||||||
use chess_core::{Direction, Square};
|
use chessfriend_core::{Direction, Square};
|
||||||
use std::sync::Once;
|
use std::sync::Once;
|
||||||
|
|
||||||
pub(super) const RANKS: [BitBoard; 8] = [
|
pub(super) const RANKS: [BitBoard; 8] = [
|
||||||
|
|
|
@ -6,4 +6,4 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chess_core = { path = "../chess_core" }
|
chessfriend_core = { path = "../core" }
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
r#move::Castle,
|
r#move::Castle,
|
||||||
Color, Position,
|
Color, Position,
|
||||||
};
|
};
|
||||||
use chess_core::{File, Rank, Square};
|
use chessfriend_core::{File, Rank, Square};
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||||
|
|
|
@ -6,7 +6,7 @@ macro_rules! piece {
|
||||||
$crate::piece::Piece::new($crate::piece::Color::$color, $crate::piece::Shape::$shape)
|
$crate::piece::Piece::new($crate::piece::Color::$color, $crate::piece::Shape::$shape)
|
||||||
};
|
};
|
||||||
($color:ident $shape:ident on $square:ident) => {
|
($color:ident $shape:ident on $square:ident) => {
|
||||||
$crate::piece::PlacedPiece::new(piece!($color $shape), chess_core::Square::$square)
|
$crate::piece::PlacedPiece::new(piece!($color $shape), chessfriend_core::Square::$square)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Eryn Wells <eryn@erynwells.me>
|
// Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
use crate::piece::{Piece, PlacedPiece, Shape};
|
use crate::piece::{Piece, PlacedPiece, Shape};
|
||||||
use chess_core::{Rank, Square};
|
use chessfriend_core::{Rank, Square};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
pub use castle::Castle;
|
pub use castle::Castle;
|
||||||
|
@ -18,7 +18,7 @@ pub enum MakeMoveError {
|
||||||
|
|
||||||
mod castle {
|
mod castle {
|
||||||
use crate::Color;
|
use crate::Color;
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
|
@ -419,8 +419,8 @@ mod move_formatter {
|
||||||
$crate::piece::Color::$color,
|
$crate::piece::Color::$color,
|
||||||
$crate::piece::Shape::$shape,
|
$crate::piece::Shape::$shape,
|
||||||
),
|
),
|
||||||
chess_core::Square::$from_square,
|
chessfriend_core::Square::$from_square,
|
||||||
chess_core::Square::$to_square,
|
chessfriend_core::Square::$to_square,
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
};
|
};
|
||||||
|
@ -430,15 +430,15 @@ mod move_formatter {
|
||||||
$crate::piece::Color::$color,
|
$crate::piece::Color::$color,
|
||||||
$crate::piece::Shape::$shape,
|
$crate::piece::Shape::$shape,
|
||||||
),
|
),
|
||||||
chess_core::Square::$from_square,
|
chessfriend_core::Square::$from_square,
|
||||||
chess_core::Square::$to_square,
|
chessfriend_core::Square::$to_square,
|
||||||
)
|
)
|
||||||
.capturing($crate::piece::PlacedPiece::new(
|
.capturing($crate::piece::PlacedPiece::new(
|
||||||
$crate::piece::Piece::new(
|
$crate::piece::Piece::new(
|
||||||
$crate::piece::Color::$captured_color,
|
$crate::piece::Color::$captured_color,
|
||||||
$crate::piece::Shape::$captured_shape,
|
$crate::piece::Shape::$captured_shape,
|
||||||
),
|
),
|
||||||
chess_core::Square::$to_square,
|
chessfriend_core::Square::$to_square,
|
||||||
))
|
))
|
||||||
.build()
|
.build()
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
piece::{Color, Piece, PlacedPiece},
|
piece::{Color, Piece, PlacedPiece},
|
||||||
BitBoard, MoveBuilder, Position,
|
BitBoard, MoveBuilder, Position,
|
||||||
};
|
};
|
||||||
use chess_core::Direction;
|
use chessfriend_core::Direction;
|
||||||
|
|
||||||
move_generator_declaration!(ClassicalMoveGenerator);
|
move_generator_declaration!(ClassicalMoveGenerator);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
piece::{Color, Piece, PlacedPiece},
|
piece::{Color, Piece, PlacedPiece},
|
||||||
BitBoard, MoveBuilder, Position,
|
BitBoard, MoveBuilder, Position,
|
||||||
};
|
};
|
||||||
use chess_core::Direction;
|
use chessfriend_core::Direction;
|
||||||
|
|
||||||
move_generator_declaration!(ClassicalMoveGenerator);
|
move_generator_declaration!(ClassicalMoveGenerator);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
piece::{Color, Piece, PlacedPiece},
|
piece::{Color, Piece, PlacedPiece},
|
||||||
BitBoard, MoveBuilder, Position,
|
BitBoard, MoveBuilder, Position,
|
||||||
};
|
};
|
||||||
use chess_core::Direction;
|
use chessfriend_core::Direction;
|
||||||
|
|
||||||
move_generator_declaration!(ClassicalMoveGenerator);
|
move_generator_declaration!(ClassicalMoveGenerator);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ impl<'pos> MoveGeneratorInternal for ClassicalMoveGenerator<'pos> {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{piece::Piece, position, position::DiagramFormatter, BitBoard, Color, Position};
|
use crate::{piece::Piece, position, position::DiagramFormatter, BitBoard, Color, Position};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn classical_single_rook_bitboard() {
|
fn classical_single_rook_bitboard() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Eryn Wells <eryn@erynwells.me>
|
// Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
use crate::display::{ASCIIDisplay, FENDisplay, UnicodeDisplay};
|
use crate::display::{ASCIIDisplay, FENDisplay, UnicodeDisplay};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::slice::Iter;
|
use std::slice::Iter;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
||||||
r#move::Castle,
|
r#move::Castle,
|
||||||
BitBoard, Color, MakeMoveError, Move, Piece, Position,
|
BitBoard, Color, MakeMoveError, Move, Piece, Position,
|
||||||
};
|
};
|
||||||
use chess_core::{Direction, Square};
|
use chessfriend_core::{Direction, Square};
|
||||||
|
|
||||||
/// A position builder that builds a new position by making a move.
|
/// A position builder that builds a new position by making a move.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -7,8 +7,8 @@ use crate::{
|
||||||
r#move::Castle,
|
r#move::Castle,
|
||||||
BitBoard, Color, MakeMoveError, Move, Piece, Position,
|
BitBoard, Color, MakeMoveError, Move, Piece, Position,
|
||||||
};
|
};
|
||||||
use chess_core::{Rank, Square};
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Builder {
|
pub struct Builder {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Eryn Wells <eryn@erynwells.me>
|
// Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
use crate::Position;
|
use crate::Position;
|
||||||
use chess_core::{File, Rank, Square};
|
use chessfriend_core::{File, Rank, Square};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
pub struct DiagramFormatter<'a>(&'a Position);
|
pub struct DiagramFormatter<'a>(&'a Position);
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
||||||
piece::{Piece, PlacedPiece},
|
piece::{Piece, PlacedPiece},
|
||||||
BitBoard, Color,
|
BitBoard, Color,
|
||||||
};
|
};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub enum PlacePieceStrategy {
|
pub enum PlacePieceStrategy {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
use super::Position;
|
use super::Position;
|
||||||
use crate::piece::{Color, Piece, PlacedPiece, Shape};
|
use crate::piece::{Color, Piece, PlacedPiece, Shape};
|
||||||
use crate::BitBoard;
|
use crate::BitBoard;
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
pub struct Pieces<'a> {
|
pub struct Pieces<'a> {
|
||||||
color: Color,
|
color: Color,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
sight::Sight,
|
sight::Sight,
|
||||||
BitBoard, Move,
|
BitBoard, Move,
|
||||||
};
|
};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
use std::{cell::OnceCell, fmt};
|
use std::{cell::OnceCell, fmt};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
|
@ -268,7 +268,7 @@ impl fmt::Display for Position {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{position, Castle, Color, Position};
|
use crate::{position, Castle, Color, Position};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn piece_on_square() {
|
fn piece_on_square() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
||||||
piece::{Color, PlacedPiece, Shape},
|
piece::{Color, PlacedPiece, Shape},
|
||||||
BitBoard, Position,
|
BitBoard, Position,
|
||||||
};
|
};
|
||||||
use chess_core::Direction;
|
use chessfriend_core::Direction;
|
||||||
|
|
||||||
pub(crate) trait Sight {
|
pub(crate) trait Sight {
|
||||||
fn sight_in_position(&self, position: &Position) -> BitBoard;
|
fn sight_in_position(&self, position: &Position) -> BitBoard;
|
||||||
|
@ -175,7 +175,7 @@ mod tests {
|
||||||
|
|
||||||
mod pawn {
|
mod pawn {
|
||||||
use crate::{sight::Sight, BitBoard};
|
use crate::{sight::Sight, BitBoard};
|
||||||
use chess_core::Square;
|
use chessfriend_core::Square;
|
||||||
|
|
||||||
sight_test!(e4_pawn, piece!(White Pawn on E4), bitboard!(D5, F5));
|
sight_test!(e4_pawn, piece!(White Pawn on E4), bitboard!(D5, F5));
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "chess_core"
|
name = "chessfriend_core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue