Title: Name of book: Hands-On Rust (Chapter 10 : Monstrous eyesight)
There is no chevron on the #[read_component(FieldOfView)]
line. If you miss this addition, you get a somewhat obtuse panic.
BTW…
Just experimenting to see if I’m starting to “get it” and instead of adding the if ~fov.visible... return;
code. I used a filter:
movers
.iter(ecs)
.filter(|(_, _, _, fov)| fov.visible_tiles.contains(&player_pos))
.for_each(|(entity, pos, _, _)| {
// if !fov.visible_tiles.contains(&player_pos) {
// return;
// }
let idx = map_idx(pos.x, pos.y);
seems more rust-like, just thought I’d toss that out.