Skip to main content

spooky_connect4/
lib.rs

1pub mod bitboard;
2pub mod board;
3pub mod encode;
4pub mod game;
5mod limits;
6pub mod r#move;
7pub mod outcome;
8pub mod player;
9pub mod position;
10
11#[cfg(feature = "python")]
12extern crate pyo3;
13
14#[cfg(feature = "python")]
15use pyo3::prelude::*;
16
17#[cfg(feature = "python")]
18mod python;
19
20#[cfg(feature = "python")]
21#[pymodule(gil_used = false)]
22fn spooky_connect4(m: &Bound<'_, PyModule>) -> PyResult<()> {
23    use player::Player;
24    use python::*;
25    m.add_class::<PyBoard>()?;
26    m.add_class::<PyGame>()?;
27    m.add_class::<PyMove>()?;
28    m.add_class::<PyGameOutcome>()?;
29    m.add_function(wrap_pyfunction!(augment_symmetries, m)?)?;
30    m.add("RED", Player::Red as i8)?;
31    m.add("YELLOW", Player::Yellow as i8)?;
32    m.add("SPATIAL_INPUT_PLANES", encode::SPATIAL_INPUT_PLANES)?;
33    m.add("GLOBAL_INPUT_FEATURES", encode::GLOBAL_INPUT_FEATURES)?;
34    Ok(())
35}