Add a const OCTAGON and use it in map.rs

We could made a bunch of pre-built Card constatns for all the basic
shapes. That way we can `Card::OCTAGON` to create one, instead of typing
out the whole function call.
This commit is contained in:
2025-08-27 12:57:02 -05:00
parent c0ed58e890
commit c39b6d2120
2 changed files with 4 additions and 14 deletions

View File

@@ -97,6 +97,9 @@ impl Card {
}
}
// TODO: The other shapes
pub const OCTAGON: Self = Self::new(OCTAGON);
/// Produces a new card by stacking another on top of this one.
pub fn merge(self, top: Self) -> (Self, Option<Self>) {
let mut new_card = Self::default();

View File

@@ -11,20 +11,7 @@ pub fn setup_test_tilemap(mut commands: Commands, assets: Res<AssetLibrary>) {
let map_size = TilemapSize { x: 9, y: 9 };
let mut tile_storage = TileStorage::empty(map_size);
let card = Card {
cells: [
Cell::NW,
Cell::Filled,
Cell::NE,
Cell::Filled,
Cell::Filled,
Cell::Filled,
Cell::SW,
Cell::Filled,
Cell::SE,
],
..Default::default()
};
let card = Card::OCTAGON;
add_card_to_tilemap(
&card,