Renamed variable to be more concise
[entelect-challenge-tower-defence.git] / src / strategy / monte_carlo.rs
index 543d5d7..adbb911 100644 (file)
@@ -2,7 +2,6 @@ use engine::command::*;
 use engine::status::GameStatus;
 use engine::bitwise_engine::{Player, BitwiseGameState};
 use engine::constants::*;
-use engine::geometry::*;
 
 use std::fmt;
 
@@ -234,7 +233,7 @@ pub fn random_move<R: Rng>(player: &Player, opponent: &Player, rng: &mut R) -> C
     if needs_energy && player.energy >= ENERGY_PRICE {
         for p in 0..NUMBER_OF_MAP_POSITIONS as u8 {
             let point = Point::new_index(p);
-            let weight = if player.occupied & point.to_either_bitfield() != 0 {
+            let weight = if player.occupied & point.to_bitfield() != 0 {
                 0
             } else {
                 2
@@ -252,7 +251,7 @@ pub fn random_move<R: Rng>(player: &Player, opponent: &Player, rng: &mut R) -> C
             let point = Point::new_index(p);
             let y = usize::from(point.y());
 
-            let weight = if player.occupied & point.to_either_bitfield() != 0 || point.x() < 4 {
+            let weight = if player.occupied & point.to_bitfield() != 0 || point.x() < 4 {
                 0
             } else {
                 defence_metric_per_row[y]
@@ -268,7 +267,7 @@ pub fn random_move<R: Rng>(player: &Player, opponent: &Player, rng: &mut R) -> C
     if player.energy >= MISSILE_PRICE {
         for p in 0..NUMBER_OF_MAP_POSITIONS as u8 {
             let point = Point::new_index(p);
-            let weight = if player.occupied & point.to_either_bitfield() != 0 {
+            let weight = if player.occupied & point.to_bitfield() != 0 {
                 0
             } else {
                 let y = usize::from(point.y());
@@ -286,7 +285,7 @@ pub fn random_move<R: Rng>(player: &Player, opponent: &Player, rng: &mut R) -> C
     if !cant_tesla {
         for p in 0..NUMBER_OF_MAP_POSITIONS as u8 {
             let point = Point::new_index(p);
-            let weight = if (player.occupied & point.to_either_bitfield() != 0) || point.y() < 7 {
+            let weight = if (player.occupied & point.to_bitfield() != 0) || point.y() < 7 {
                 0
             } else {
                 10