From 1ce5291777e9e50619ccddf7b7a49a9c421e10a9 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sun, 13 Oct 2024 00:57:58 +0200 Subject: [PATCH] make math tiles read digits --- README.md | 1 - src/marble_engine/tile.rs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4322e06..08d475b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ copy/cut/paste selections timestamps in solutions and blueprints multiple input/output sets undo/redo -make math tiles read digits tooltips lock tile types for early levels to make it less overwhelming display tool variant more clearly (it's not obvious there are more states) diff --git a/src/marble_engine/tile.rs b/src/marble_engine/tile.rs index 703c221..89e4072 100644 --- a/src/marble_engine/tile.rs +++ b/src/marble_engine/tile.rs @@ -150,10 +150,10 @@ impl Tile { } pub fn read_value(&self) -> MarbleValue { - if let Tile::Marble { value, dir: _ } = self { - *value - } else { - 0 + match self { + Tile::Marble { value, dir: _ } => *value, + Tile::Digit(d) => *d as MarbleValue, + _ => 0, } }