diff --git a/src/card.rs b/src/card.rs index 048a87d..6c9cecf 100644 --- a/src/card.rs +++ b/src/card.rs @@ -82,6 +82,21 @@ pub struct Card { } impl Card { + /// Create a new card from the given Cell array + pub const fn new(cells: [Cell; 9]) -> Self { + Self { + cells, + nw: false, + n: false, + ne: false, + w: false, + e: false, + sw: false, + s: false, + se: false, + } + } + /// Produces a new card by stacking another on top of this one. pub fn merge(self, top: Self) -> (Self, Option) { let mut new_card = Self::default();