Chess engine in zig
const std = @import("std");

const Board = @import("Board.zig");

pub const Colors = enum {
    white,
    black,

    pub inline fn enemy(self: @This()) Colors {
        switch (self) {
            .white => return .black,
            .black => return .white,
        }
    }
};

pub const Pieces = enum {
    pawn,
    knight,
    bishop,
    rook,
    queen,
    king,
};

pub const PE = enum {
    P,
    N,
    B,
    R,
    Q,
    K,
    p,
    n,
    b,
    r,
    q,
    k,
    none,

    pub fn char(self: @This()) u8 {
        return switch (self) {
            .P => 'P',
            .N => 'N',
            .B => 'B',
            .R => 'R',
            .Q => 'Q',
            .K => 'K',
            .p => 'p',
            .n => 'n',
            .b => 'b',
            .r => 'r',
            .q => 'q',
            .k => 'k',
            .none => unreachable,
        };
    }
};