Skip to content

Commit

Permalink
content: Add exhibit with BecomeBlinker block.
Browse files Browse the repository at this point in the history
Eventually I want some more interesting test cases involving modifiers,
but this is enough to have a reminder the thing exists.
  • Loading branch information
kpreid committed Dec 17, 2023
1 parent 4f17c52 commit 02c365b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions all-is-cubes-content/src/exhibits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub(crate) static DEMO_CITY_EXHIBITS: &[Exhibit] = &[
COLORS,
TEXT,
ZOOM,
BECOME,
];

macro_rules! exhibit {
Expand Down Expand Up @@ -781,6 +782,27 @@ async fn MOVED_BLOCKS(_: &Exhibit, universe: &mut Universe) {
Ok(space)
}

#[macro_rules_attribute::apply(exhibit!)]
#[exhibit(
name: "Operation::Become",
subtitle: "",
placement: Placement::Surface,
)]
async fn BECOME(_: &Exhibit, universe: &mut Universe) {
let demo_blocks = BlockProvider::<DemoBlocks>::using(universe)?;
let pedestal = &demo_blocks[DemoBlocks::Pedestal];

let mut space = Space::builder(GridAab::from_lower_size([0, 0, 0], [1, 2, 3])).build();
for (state, z) in [(false, 0), (true, 2)] {
stack(
&mut space,
[0, 0, z],
[pedestal, &demo_blocks[DemoBlocks::BecomeBlinker(state)]],
)?;
}

Ok(space)
}
#[macro_rules_attribute::apply(exhibit!)]
#[exhibit(
name: "Colors",
Expand Down

0 comments on commit 02c365b

Please sign in to comment.