wonder's placement requirement checker

This commit is contained in:
AlphaCodingPilot 2023-07-09 10:25:36 +02:00
commit 067dc983d3
2 changed files with 4 additions and 2 deletions

View file

@ -111,7 +111,9 @@ impl City {
return false;
}
}
//todo! use wonder's placement checker
if let Some(placement_requirement) = &wonder.placement_requirement {
return placement_requirement(&self.position);
}
true
}

View file

@ -118,7 +118,7 @@ impl PlayingAction {
let player = &mut game.players[player_index];
let starting_city = player
.get_city(&starting_city_position)
.expect("player should have position");
.expect("Illegal action");
if matches!(&city_piece, Obelisk)
|| starting_city.player_index != player_index
|| !player.resources().can_afford(&range_boost_cost)