sudoku_machine/
lib.rs

1use bevy::prelude::*;
2use plugins::game::PuzzleType;
3
4pub mod plugins {
5    pub mod common;
6    pub mod fps;
7    pub mod game;
8    pub mod menu;
9    pub mod nav;
10}
11
12pub mod puzzles {
13    pub mod classic;
14}
15
16pub mod grids {
17    pub mod classic;
18}
19
20pub mod utility {
21    pub mod bitset;
22    pub mod element_set;
23    pub mod priority_queue;
24    pub mod seed;
25}
26
27pub const APP_TITLE: &str = "Sudoku Machine";
28
29#[derive(Clone, Debug, Default, Eq, Hash, PartialEq, States)]
30pub enum AppState {
31    #[default]
32    Menu,
33    Game,
34}
35
36// Generic system that takes a component as a parameter, and will despawn all entities with that component
37pub fn despawn_component<T: Component>(to_despawn: Query<Entity, With<T>>, mut commands: Commands) {
38    for entity in &to_despawn {
39        commands.entity(entity).despawn();
40    }
41}
42
43#[derive(Default, Resource)]
44pub struct PuzzleSettings {
45    pub puzzle_type: PuzzleType,
46    pub seed: String,
47}