diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2018-07-15 22:55:55 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2018-07-15 22:55:55 +0200 |
commit | 8f88b294511b786e8ae518594eceafb8da9d3f34 (patch) | |
tree | 70e522a4ace3d7702ac20a8e7d90962aec10470a /src/input | |
parent | 02e5c2a8687a0beb907a29121a9d8dbe8c672530 (diff) |
Flipped bitfields on the opponent side to make implementation more concise
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/json.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input/json.rs b/src/input/json.rs index c3d8474..000c355 100644 --- a/src/input/json.rs +++ b/src/input/json.rs @@ -202,12 +202,12 @@ impl State { } } for missile in &cell.missiles { - let mut bitwise_buildings = if missile.player_type == 'A' { - &mut player_buildings + let bitfields = point.to_bitfield(); + let (mut bitwise_buildings, mut left, mut right) = if missile.player_type == 'A' { + (&mut player_buildings, bitfields.0, bitfields.1) } else { - &mut opponent_buildings + (&mut opponent_buildings, bitfields.1, bitfields.0) }; - let (mut left, mut right) = point.to_bitfield(); for mut tier in bitwise_buildings.missiles.iter_mut() { let setting = (!tier.0 & left, !tier.1 & right); |