Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
foxzool committed Dec 26, 2024
1 parent 0d24c14 commit 5a8a4da
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
14 changes: 3 additions & 11 deletions src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@ use crate::{
cell_state::{
AutoCandidates, CandidatesValue, CellMode, CellValueBundle, ConflictCell,
CorrectionCell, DigitValueCell, FixedCell, ManualCandidates, RevealedCell,
SelectedCell,
},
control_tab::control_board,
dialog::{dialog_container, DialogContainer, PauseGame, ShowHint},
dialog::{dialog_container, PauseGame, ShowHint},
input::{keyboard_input, keyboard_move_cell},
position::CellPosition,
},
loading::{FontAssets, TextureAssets},
share::title_bar,
GameState,
};
use bevy::{
color::palettes::{basic::RED, css::LIGHT_YELLOW},
prelude::*,
time::Stopwatch,
utils::{info, HashSet},
};
use bevy::{prelude::*, time::Stopwatch, utils::HashSet};
use sudoku::{
bitset::Set,
board::{CellState, Digit},
Expand Down Expand Up @@ -426,10 +422,6 @@ fn left_bar(
});
}

/// 选中的格子
#[derive(Component)]
pub struct SelectedCell;

#[derive(Event)]
pub enum MoveSelectCell {
Up,
Expand Down
14 changes: 7 additions & 7 deletions src/game/board.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::game::cell_state::{ConflictCell, CorrectionCell};
use crate::{
color::*,
game::cell_state::{
AutoCandidateCellMarker, CandidateMarker, CandidatesValue, ManualCandidateCellMarker,
RevealedCell,
},
game::cell_state::{AutoCandidates, CellMode, DigitValueCell, ManualCandidates},
game::position::CellPosition,
game::{
cell_state::{
AutoCandidateCellMarker, CandidateMarker, CandidatesValue, ManualCandidateCellMarker,
RevealedCell,
},
cell_state::{AutoCandidates, CellMode, DigitValueCell, ManualCandidates},
position::CellPosition,
AutoCandidateMode, AutoCandidatesContainer, DigitCellContainer, ManualCandidatesContainer,
MoveSelectCell, SelectedCell,
},
Expand Down Expand Up @@ -42,7 +42,7 @@ pub(crate) fn plugin(app: &mut App) {

pub(crate) fn play_board(
font_assets: &Res<FontAssets>,
texture_assets: &Res<TextureAssets>,
_texture_assets: &Res<TextureAssets>,
builder: &mut ChildBuilder,
) {
builder
Expand Down
6 changes: 5 additions & 1 deletion src/game/cell_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ pub struct RevealedCell;

/// 纠正的格子
#[derive(Component)]
pub struct CorrectionCell;
pub struct CorrectionCell;

/// 选中的格子
#[derive(Component)]
pub struct SelectedCell;
1 change: 0 additions & 1 deletion src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::loading::{FontAssets, TextureAssets};
use crate::share::title_bar;
use crate::GameState;
use bevy::prelude::*;
use bevy::winit::cursor::CustomCursor::Image;

pub struct MenuPlugin;

Expand Down

0 comments on commit 5a8a4da

Please sign in to comment.