pub struct Game {
pub event_receiver: Receiver<Event>,
pub ghost_piece: Option<Piece>,
pub held_piece: Option<Piece>,
pub hold_used: bool,
pub level: u16,
pub lines_cleared: u16,
pub moving_piece: Piece,
pub next_pieces: Vec<Piece>,
pub playfield: [[i16; 10]; 22],
pub score: u16,
pub speed_info_sender: Sender<u64>,
}Fields§
§event_receiver: Receiver<Event>§ghost_piece: Option<Piece>§held_piece: Option<Piece>§hold_used: bool§level: u16§lines_cleared: u16§moving_piece: Piece§next_pieces: Vec<Piece>§playfield: [[i16; 10]; 22]§score: u16§speed_info_sender: Sender<u64>Implementations§
Source§impl Game
impl Game
pub fn get_next_piece_in_queue(&mut self, pop: bool) -> Piece
pub fn piece_is_in_allowed_position( &self, piece: &Piece, ) -> Result<(), MinoesError>
pub fn piece_is_out_of_bounds(&self, piece: &Piece) -> bool
pub fn piece_is_overlapping_with(&self, piece: &Piece, checked: i16) -> bool
pub fn add_piece_to_field(&mut self, piece: Piece) -> Result<(), MinoesError>
pub fn rotate_moving_piece( &mut self, direction: &Rotation, ) -> Result<(), OutOfBoundsError>
pub fn move_moving_piece( &mut self, direction: TetrisDirection, ) -> Result<(), OutOfBoundsError>
pub fn hard_drop_moving_piece(&mut self) -> Result<(), MinoesError>
pub fn hold_moving_piece(&mut self) -> Result<(), MinoesError>
pub fn clear_filled_lines(&mut self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl !Sync for Game
impl Unpin for Game
impl UnwindSafe for Game
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more