summaryrefslogtreecommitdiff
path: root/engine/src/matrix.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/matrix.rs')
-rw-r--r--engine/src/matrix.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/src/matrix.rs b/engine/src/matrix.rs
index 7e161f2..c060b59 100644
--- a/engine/src/matrix.rs
+++ b/engine/src/matrix.rs
@@ -10,6 +10,15 @@ pub struct Matrix<Value, const ROWS: usize, const COLUMNS: usize>
impl<Value, const ROWS: usize, const COLUMNS: usize> Matrix<Value, ROWS, COLUMNS>
{
+ pub fn new() -> Self
+ where
+ Value: Default + Copy,
+ {
+ Self {
+ items: [[Value::default(); ROWS]; COLUMNS],
+ }
+ }
+
/// Sets the value at the specified cell.
pub fn set_cell(&mut self, row: usize, column: usize, value: Value)
{