1#![allow(clippy::needless_doctest_main, clippy::collapsible_if)]
17#![deny(
18 missing_debug_implementations,
20 missing_copy_implementations,
21 trivial_casts,
22 trivial_numeric_casts,
23 unstable_features,
25 unused_import_braces,
26 unused_qualifications
27)]
28
29mod board;
32pub use crate::board::*;
33
34mod chess;
35pub use crate::chess::*;
36
37mod piece;
38pub use crate::piece::*;
39
40mod color;
41pub use crate::color::*;
42
43mod castle_rights;
44pub use crate::castle_rights::*;
45
46mod error;
47pub use crate::error::*;
48
49mod config;
50pub use crate::config::*;
51
52mod square;
53pub use crate::square::*;
54
55mod file;
56pub use crate::file::*;
57
58mod rank;
59pub use crate::rank::*;
60
61mod chess_move;
62pub use crate::chess_move::*;
63
64mod direction;
65pub use crate::direction::*;
66
67mod chess_gui;
70pub use crate::chess_gui::*;
71
72mod button;
73pub use crate::button::*;
74
75mod theme;
76pub use crate::theme::*;
77
78pub fn run(game: ChessGui) {
82 let default_conf = ggez::conf::Conf {
83 window_mode: ggez::conf::WindowMode::default()
84 .dimensions(SCREEN_PX_SIZE.0, SCREEN_PX_SIZE.1),
85 window_setup: ggez::conf::WindowSetup::default()
86 .title("Chess")
87 .icon("/images/icon.png"),
88 backend: ggez::conf::Backend::default(),
89 modules: ggez::conf::ModuleConf {
90 gamepad: false,
91 audio: false,
92 },
93 };
94 let (ctx, event_loop) =
95 ggez::ContextBuilder::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_AUTHORS"))
96 .add_resource_path::<std::path::PathBuf>(
97 [env!("CARGO_MANIFEST_DIR"), "resources"].iter().collect(),
98 )
99 .default_conf(default_conf)
100 .build()
101 .expect("Failed to build ggez context");
102
103 ggez::event::run(ctx, event_loop, game)
104}