fix check clear

This commit is contained in:
mii8080
2021-10-03 00:22:29 +00:00
committed by GitHub
parent a48a8a17a5
commit 0263237729

View File

@ -5,9 +5,9 @@ mod rustris;
mod mino_rotation;
mod game_status;
mod super_rotation;
use std::{io::stdout, process::exit, sync::{Arc, Mutex}, thread, time::Duration};
use std::{io::stdout, sync::{Arc, Mutex}, thread, time::Duration};
use crossterm::{cursor, event::{Event, KeyCode, KeyEvent, KeyModifiers, read}, execute, style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor}, terminal::{self, Clear, ClearType, enable_raw_mode}};
use crossterm::{cursor, event::{Event, KeyCode, KeyEvent, KeyModifiers, read}, execute, style::{Color, Print, ResetColor, SetBackgroundColor}, terminal::{self, Clear, ClearType, enable_raw_mode}};
use game_data::GameData;
use game_status::GameStatus;
use mino_rotation::MinoRotation;
@ -164,6 +164,8 @@ fn main() {
} else {
rustris_rc.place_control_mino(Block::Block);
rustris_rc.next_mino();
rustris_rc.check_clear();
ground_flag = false;
*control_count_rc.lock().unwrap() = 0;
before_control_count = 0;
@ -235,6 +237,7 @@ fn main() {
modifiers: KeyModifiers::NONE
}) => {
let mut rustris = rustris.lock().unwrap();
if let Some(holding) = rustris.game_data.hold_mino.clone() {
let control_tmp = rustris.game_data.control_mino.clone();
rustris.game_data.control_mino = Some(holding);