[core] Rename (once again) chess_core → chessfriend_core

This commit is contained in:
Eryn Wells 2024-01-24 08:48:19 -08:00
parent 625bfb2446
commit b0b22048a8
21 changed files with 30 additions and 30 deletions

View file

@ -3,6 +3,6 @@
members = [
"board",
"chess_bitboard",
"chess_core",
"chessfriend_core",
"explorer",
]

View file

@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
core = { path = "../core" }
chessfriend_core = { path = "../core" }

View file

@ -2,7 +2,7 @@
use crate::library::{library, FILES, RANKS};
use crate::LeadingBitScanner;
use chess_core::{Direction, Square};
use chessfriend_core::{Direction, Square};
use std::fmt;
use std::ops::Not;

View file

@ -12,7 +12,7 @@ pub(crate) use bitboard::{BitBoard, BitBoardBuilder};
macro_rules! bitboard {
($($sq:ident),* $(,)?) => {
$crate::bitboard::BitBoardBuilder::empty()
$(.square(chess_core::Square::$sq))*
$(.square(chessfriend_core::Square::$sq))*
.build()
};
}

View file

@ -1,7 +1,7 @@
// Eryn Wells <eryn@erynwells.me>
use super::BitBoard;
use chess_core::{Direction, Square};
use chessfriend_core::{Direction, Square};
use std::sync::Once;
pub(super) const RANKS: [BitBoard; 8] = [

View file

@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
chess_core = { path = "../chess_core" }
chessfriend_core = { path = "../core" }

View file

@ -5,7 +5,7 @@ use crate::{
r#move::Castle,
Color, Position,
};
use chess_core::{File, Rank, Square};
use chessfriend_core::{File, Rank, Square};
use std::fmt::Write;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]

View file

@ -6,7 +6,7 @@ macro_rules! piece {
$crate::piece::Piece::new($crate::piece::Color::$color, $crate::piece::Shape::$shape)
};
($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)
}
}

View file

@ -1,7 +1,7 @@
// Eryn Wells <eryn@erynwells.me>
use crate::piece::{Piece, PlacedPiece, Shape};
use chess_core::{Rank, Square};
use chessfriend_core::{Rank, Square};
use std::fmt;
pub use castle::Castle;
@ -18,7 +18,7 @@ pub enum MakeMoveError {
mod castle {
use crate::Color;
use chess_core::Square;
use chessfriend_core::Square;
#[repr(u16)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@ -419,8 +419,8 @@ mod move_formatter {
$crate::piece::Color::$color,
$crate::piece::Shape::$shape,
),
chess_core::Square::$from_square,
chess_core::Square::$to_square,
chessfriend_core::Square::$from_square,
chessfriend_core::Square::$to_square,
)
.build()
};
@ -430,15 +430,15 @@ mod move_formatter {
$crate::piece::Color::$color,
$crate::piece::Shape::$shape,
),
chess_core::Square::$from_square,
chess_core::Square::$to_square,
chessfriend_core::Square::$from_square,
chessfriend_core::Square::$to_square,
)
.capturing($crate::piece::PlacedPiece::new(
$crate::piece::Piece::new(
$crate::piece::Color::$captured_color,
$crate::piece::Shape::$captured_shape,
),
chess_core::Square::$to_square,
chessfriend_core::Square::$to_square,
))
.build()
};

View file

@ -5,7 +5,7 @@ use crate::{
piece::{Color, Piece, PlacedPiece},
BitBoard, MoveBuilder, Position,
};
use chess_core::Direction;
use chessfriend_core::Direction;
move_generator_declaration!(ClassicalMoveGenerator);

View file

@ -5,7 +5,7 @@ use crate::{
piece::{Color, Piece, PlacedPiece},
BitBoard, MoveBuilder, Position,
};
use chess_core::Direction;
use chessfriend_core::Direction;
move_generator_declaration!(ClassicalMoveGenerator);

View file

@ -5,7 +5,7 @@ use crate::{
piece::{Color, Piece, PlacedPiece},
BitBoard, MoveBuilder, Position,
};
use chess_core::Direction;
use chessfriend_core::Direction;
move_generator_declaration!(ClassicalMoveGenerator);
@ -63,7 +63,7 @@ impl<'pos> MoveGeneratorInternal for ClassicalMoveGenerator<'pos> {
mod tests {
use super::*;
use crate::{piece::Piece, position, position::DiagramFormatter, BitBoard, Color, Position};
use chess_core::Square;
use chessfriend_core::Square;
#[test]
fn classical_single_rook_bitboard() {

View file

@ -1,7 +1,7 @@
// Eryn Wells <eryn@erynwells.me>
use crate::display::{ASCIIDisplay, FENDisplay, UnicodeDisplay};
use chess_core::Square;
use chessfriend_core::Square;
use std::fmt;
use std::slice::Iter;

View file

@ -6,7 +6,7 @@ use crate::{
r#move::Castle,
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.
#[derive(Clone)]

View file

@ -7,8 +7,8 @@ use crate::{
r#move::Castle,
BitBoard, Color, MakeMoveError, Move, Piece, Position,
};
use chess_core::{Rank, Square};
use std::collections::BTreeMap;
use chessfriend_core::Square;
#[derive(Clone)]
pub struct Builder {

View file

@ -1,7 +1,7 @@
// Eryn Wells <eryn@erynwells.me>
use crate::Position;
use chess_core::{File, Rank, Square};
use chessfriend_core::{File, Rank, Square};
use std::fmt;
pub struct DiagramFormatter<'a>(&'a Position);

View file

@ -4,7 +4,7 @@ use crate::{
piece::{Piece, PlacedPiece},
BitBoard, Color,
};
use chess_core::Square;
use chessfriend_core::Square;
#[derive(Debug, Eq, PartialEq)]
pub enum PlacePieceStrategy {

View file

@ -3,7 +3,7 @@
use super::Position;
use crate::piece::{Color, Piece, PlacedPiece, Shape};
use crate::BitBoard;
use chess_core::Square;
use chessfriend_core::Square;
pub struct Pieces<'a> {
color: Color,

View file

@ -9,7 +9,7 @@ use crate::{
sight::Sight,
BitBoard, Move,
};
use chess_core::Square;
use chessfriend_core::Square;
use std::{cell::OnceCell, fmt};
#[derive(Clone, Debug, Eq, PartialEq)]
@ -268,7 +268,7 @@ impl fmt::Display for Position {
#[cfg(test)]
mod tests {
use crate::{position, Castle, Color, Position};
use chess_core::Square;
use chessfriend_core::Square;
#[test]
fn piece_on_square() {

View file

@ -4,7 +4,7 @@ use crate::{
piece::{Color, PlacedPiece, Shape},
BitBoard, Position,
};
use chess_core::Direction;
use chessfriend_core::Direction;
pub(crate) trait Sight {
fn sight_in_position(&self, position: &Position) -> BitBoard;
@ -175,7 +175,7 @@ mod tests {
mod pawn {
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));

View file

@ -1,5 +1,5 @@
[package]
name = "chess_core"
name = "chessfriend_core"
version = "0.1.0"
edition = "2021"