From 1d1ca2fdae780efdb9d27394f5d3720fe9282c91 Mon Sep 17 00:00:00 2001 From: curly Date: Sat, 13 Aug 2022 17:21:42 -0600 Subject: define everthing I can think of --- src/tetris.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/tetris.rs (limited to 'src/tetris.rs') diff --git a/src/tetris.rs b/src/tetris.rs new file mode 100644 index 0000000..9f9cda8 --- /dev/null +++ b/src/tetris.rs @@ -0,0 +1,28 @@ +mod piece; + +use piece::Piece; + +#[derive(Debug)] +pub struct Tetris { + grid: Vec> +} +impl Tetris { + pub fn new() -> Tetris { + Tetris{ + grid: vec!(vec!(0; 10); 20), + } + } + + // Return the grid + pub fn return_grid(&self) -> &Vec> { + &self.grid + } + + // Set the grid, given a piece + pub fn set_grid(&mut self, piece: Piece) {} + + // Check each row of the grid + // If one is full, remove it and drop + // the rest of the grid down + pub fn check_lines() {} +} \ No newline at end of file -- cgit v1.2.3