1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#![allow(dead_code)]

pub mod board;
pub mod chess;
pub mod constants;
pub mod error;
pub mod polyglot;
pub mod syzygy;
pub mod timer;
pub mod tt;
pub mod uci;
pub mod useful_macros;
pub mod utils;

#[cfg(feature = "engine")]
pub mod engine;

#[cfg(feature = "engine")]
pub mod parse;

#[cfg(feature = "engine")]
pub mod search;

#[cfg(feature = "engine")]
pub mod selfplay;

#[cfg(feature = "engine")]
pub mod sort;

#[cfg(feature = "engine")]
pub mod tests;

#[cfg(feature = "engine")]
pub mod engine_features {
    use super::*;
    pub use constants::engine::*;
    pub use parse::*;
    pub use search::*;
    pub use sort::*;
    pub use tests::test;
}

#[cfg(feature = "engine")]
pub use engine_features::*;

#[cfg(feature = "nnue")]
pub mod evaluate;

#[cfg(feature = "nnue")]
pub mod nnue;

#[cfg(feature = "nnue")]
pub mod nnue_rs;

#[cfg(feature = "nnue")]
pub mod nnue_features {
    use super::*;
    pub use evaluate::*;
}

#[cfg(feature = "nnue")]
pub use nnue_features::*;

#[cfg(feature = "nnue")]
lazy_static! {
    pub static ref EVALUATOR: Evaluator = Evaluator::default();
}

pub mod prelude {
    use super::*;
    pub use board::*;
    pub use chess::*;
    pub use constants::bitboard_and_square::*;
    pub use constants::fen::*;
    pub use constants::files::*;
    pub use constants::piece::*;
    pub use constants::ranks::*;
    pub use constants::types::*;
    pub use error::*;
    pub use itertools::*;
    pub use paste::paste;
    pub use polyglot::*;
    pub use utils::*;
    // pub use syzygy::*;
    // pub use std::hint;
    // pub use std::num;

    #[cfg(feature = "engine")]
    pub use engine::{Engine, GoCommand};

    #[cfg(feature = "engine")]
    pub use selfplay::self_play;
}

pub use arrayvec::ArrayVec;
pub use constants::atomic::*;
pub use constants::board::*;
pub use constants::color::*;
pub use constants::description::*;
pub use constants::io::*;
pub use constants::nnue::*;
pub use constants::print_style::*;
pub use failure::Fail;
pub use lazy_static::lazy_static;
pub use prelude::*;
pub use std::cmp::Ordering;
pub use std::convert::From;
pub use std::env;
pub use std::error::Error;
pub use std::fmt;
pub use std::fs;
pub use std::mem::{self, transmute};
pub use std::num::ParseIntError;
pub use std::ops::{
    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Index,
    IndexMut, Mul, MulAssign, Not, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
};
pub use std::str::{FromStr, ParseBoolError};
pub use std::sync::atomic::{AtomicBool, AtomicUsize};
pub use std::sync::{Arc, Mutex};
pub use std::thread;
pub use std::time::{Duration, Instant};
pub use timer::Timer;
pub use tt::*;
pub use uci::*;

lazy_static! {
    pub static ref TRANSPOSITION_TABLE: TranspositionTable = TranspositionTable::default();
    pub static ref IO_READER: IoReader = IoReader::default();
    pub static ref UCI_OPTIONS: UCIOptions = UCIOptions::default();
}

pub static UCI_STATE: EngineUCIState = EngineUCIState::new();