Fix tetris-logic lib
This commit is contained in:
parent
2978a661d5
commit
537e6fa8ed
@ -10,7 +10,7 @@ pub struct BlockGrid {
|
||||
|
||||
impl BlockGrid {
|
||||
pub fn new() -> BlockGrid {
|
||||
let mut state = [[None; 20]; 10];
|
||||
let state = [[None; 20]; 10];
|
||||
BlockGrid {
|
||||
state,
|
||||
active_piece: None,
|
||||
@ -23,7 +23,7 @@ impl BlockGrid {
|
||||
|
||||
/// If it's impossible to drop a piece, return false
|
||||
pub fn drop_piece(&mut self, tetromino: Tetromino) -> bool {
|
||||
if let None = self.active_piece {
|
||||
if self.active_piece.is_none() {
|
||||
let piece = ActivePiece {
|
||||
location: START_LOCATION,
|
||||
tetromino,
|
||||
|
Loading…
Reference in New Issue
Block a user