Skip to content

Commit

Permalink
move KingTag into variant section
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Sep 22, 2024
1 parent 2397776 commit 4815a25
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,15 @@ pub(crate) mod variant {

use super::*;

enum KingTag {}

impl Stepper for KingTag {
const ROLE: Role = Role::King;
fn attacks(from: Square) -> Bitboard {
attacks::king_attacks(from)
}
}

/// An Atomic Chess position.
#[derive(Clone, Debug)]
pub struct Atomic {
Expand Down Expand Up @@ -3190,7 +3199,6 @@ enum KnightTag {}
enum BishopTag {}
enum RookTag {}
enum QueenTag {}
enum KingTag {}

impl Stepper for KnightTag {
const ROLE: Role = Role::Knight;
Expand All @@ -3199,13 +3207,6 @@ impl Stepper for KnightTag {
}
}

impl Stepper for KingTag {
const ROLE: Role = Role::King;
fn attacks(from: Square) -> Bitboard {
attacks::king_attacks(from)
}
}

impl Slider for BishopTag {
const ROLE: Role = Role::Bishop;
fn attacks(from: Square, occupied: Bitboard) -> Bitboard {
Expand Down

0 comments on commit 4815a25

Please sign in to comment.