Dig marks in the colour of the master who set them; every master's dungeon is lit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5121a2109b
commit
450e55d693
5 files changed
+65
-12
No files matched your search
@@ -447,6 +447,22 @@ mod tests {
|
||||
assert!(g.torches.iter().any(|t| g.map.t[t.wall].owner == owner || g.map.t[t.wall].solid()), "torches");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ai_dig_marks_carry_the_masters_side() {
|
||||
let mut g = rival_game(1);
|
||||
let side = g.rivals[0].side;
|
||||
for _ in 0..(40 * 20) {
|
||||
g.update(0.05);
|
||||
}
|
||||
assert!(g.map.t.iter().any(|t| t.marked && t.mark_by == side), "the AI marks in its own colour");
|
||||
let back = crate::save::from_bytes(crate::save::to_json(&g).as_bytes()).ok().expect("loads").game;
|
||||
assert_eq!(
|
||||
back.map.t.iter().filter(|t| t.marked && t.mark_by == side).count(),
|
||||
g.map.t.iter().filter(|t| t.marked && t.mark_by == side).count(),
|
||||
"kept in the save"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn beating_the_rival_wins_the_free_game() {
|
||||
let mut g = rival_game(1);
|
||||
|
||||
Reference in new issue
Block a user