rename bag and trigger to silo and button

This commit is contained in:
Crispy 2024-12-12 22:56:01 +01:00
parent 6dcb6c9dd7
commit 611a02c3b4
3 changed files with 21 additions and 21 deletions

View file

@ -117,7 +117,7 @@ impl Machine {
continue;
}
}
Some(Tile::Trigger(true)) => (),
Some(Tile::Button(true)) => (),
_ => continue,
}
let Some(front_tile) = self.board.get_mut(front_pos) else {
@ -151,7 +151,7 @@ impl Machine {
new_marbles.push((front_pos, value, dir));
}
}
PTile::Bag => {
PTile::Silo => {
if front_tile == &Tile::BLANK {
new_marbles.push((front_pos, 0, dir));
}
@ -173,7 +173,7 @@ impl Machine {
}
}
}
Some(Tile::Trigger(_state)) => (),
Some(Tile::Button(_state)) => (),
Some(Tile::Wire(_, _state)) => (),
_ => unreachable!(),
};
@ -202,7 +202,7 @@ impl Machine {
// so they can figure out which directions they are powered from
for &p in &self.powered {
match self.board.get_mut(p) {
Some(Tile::Trigger(state)) => *state = false,
Some(Tile::Button(state)) => *state = false,
Some(Tile::Wire(_, state)) => *state = false,
_ => (),
}
@ -298,7 +298,7 @@ impl Machine {
let target_pos = match front_tile {
Tile::Arrow(d) => d.step(front_pos),
Tile::Mirror(m) => m.new_dir(dir).step(front_pos),
Tile::Trigger(_) => dir.step(front_pos),
Tile::Button(_) => dir.step(front_pos),
_ => continue,
};
let Some(target_tile) = self.board.get_mut(target_pos) else {
@ -357,7 +357,7 @@ impl Machine {
}
} else {
let target_pos;
let mut is_trigger = false;
let mut is_button = false;
let mut new_dir = dir;
match front_tile {
Tile::Arrow(d) => {
@ -368,11 +368,11 @@ impl Machine {
new_dir = m.new_dir(dir);
target_pos = new_dir.step(front_pos);
}
Tile::Trigger(_) => {
is_trigger = true;
Tile::Button(_) => {
is_button = true;
target_pos = dir.step(front_pos);
}
Tile::Powerable(PTile::Bag, _) => {
Tile::Powerable(PTile::Silo, _) => {
removed_marbles.push(i);
continue;
}
@ -388,7 +388,7 @@ impl Machine {
};
if let Tile::Open(space_type, Claim::ClaimedIndirect) = target_tile {
move_to(*space_type, target_pos, new_dir, &mut self.board);
if is_trigger {
if is_button {
self.powered.push(front_pos);
}
}
@ -415,7 +415,7 @@ impl Machine {
unreachable!()
};
match tile {
Tile::Trigger(state) => {
Tile::Button(state) => {
*state = true;
for dir in Direction::ALL {
let target_pos = dir.step(pos);
@ -471,7 +471,7 @@ impl Machine {
continue;
}
}
Some(Tile::Trigger(true)) => (),
Some(Tile::Button(true)) => (),
_ => continue,
}
let Some(front_tile) = self.board.get_mut(front_pos) else {