feat: Game Struct started and tests on the way
This commit is contained in:
21
src/gamedata/mod.rs
Normal file
21
src/gamedata/mod.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
pub struct Board {
|
||||
p1_score: i32,
|
||||
p2_score: i32,
|
||||
columns: Vec<Vec<i32>>,
|
||||
}
|
||||
|
||||
impl Default for Board {
|
||||
fn default() -> Self {
|
||||
let mut columns = Vec::with_capacity(6);
|
||||
for _num in 0..7 {
|
||||
columns.push(Vec::with_capacity(7))
|
||||
}
|
||||
Self {
|
||||
p1_score: 0,
|
||||
p2_score: 0,
|
||||
columns,
|
||||
}
|
||||
}
|
||||
}
|
||||
0
src/gamedata/tests.rs
Normal file
0
src/gamedata/tests.rs
Normal file
Reference in New Issue
Block a user