From 0abe6a0b115fd8dfd16a8621b537b4341cdfd690 Mon Sep 17 00:00:00 2001 From: nikhilsardana <2018nsardana@tjhsst.edu> Date: Thu, 28 Jan 2021 07:07:09 -0500 Subject: [PATCH] fix ec noy recognize new allies bug --- src/jefferson/EnlightmentCenter.java | 62 +++++++++++++++++++++------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/src/jefferson/EnlightmentCenter.java b/src/jefferson/EnlightmentCenter.java index fa6a5a5..5a4b96e 100644 --- a/src/jefferson/EnlightmentCenter.java +++ b/src/jefferson/EnlightmentCenter.java @@ -53,7 +53,7 @@ public class EnlightmentCenter extends Robot { // Environment and enemy; maps from MapLocations to influences. If influence is unknown it is null. Map enemyECLocsToInfluence; Map neutralECLocsToInfluence; - Map capturedAllyECLocsToInfluence; // for an ally captured after us, our robots only communicate + Map allyECLocsToInfluence; // for an ally captured after us, our robots only communicate // the new ally's location, not the ID. So, we cannot add that ally // to the allyECID/location arrays above, we must maintain this separate map. Map sentRobotsToNeutralECs; @@ -126,7 +126,7 @@ public EnlightmentCenter(RobotController rc) throws GameActionException { // Initialize environment and enemy tracking variables enemyECLocsToInfluence = new HashMap(); neutralECLocsToInfluence = new HashMap(); - capturedAllyECLocsToInfluence = new HashMap(); + allyECLocsToInfluence = new HashMap(); sentRobotsToNeutralECs = new HashMap(); enemySlanderer = null; // a location to send muckrackers where we have previously seen an enemy slanderer. enemySlandererRound = 0; @@ -515,7 +515,7 @@ MapLocation optimalSlandererDestination() { boolean existsAllyCloser(MapLocation enemyLoc) { int dist2 = myLocation.distanceSquaredTo(enemyLoc); - if (numAllyECs == 0 && capturedAllyECLocsToInfluence.isEmpty()) { + if (numAllyECs == 0 && allyECLocsToInfluence.isEmpty()) { return false; } else { for (int i=0; i