Evolution Tournament Code
Status: Beta
Brought to you by:
townsendr
--- a/trunk/src/Evolution.java +++ b/trunk/src/Evolution.java @@ -781,7 +781,7 @@ * then evaluates whether a standoff occurred, the animal survived, or the animal was killed. * Allocates the animal's Life evenly between the killers if the animal dies (any excess Life * that can't be evenly divided amongst the killers is lost.) Uses the - * <i>killrulesLifeThreshold</i> setting if <i>killRulesLifeBased</i> is set. + * <i>killRulesLifeThreshold</i> setting if <i>killRulesLifeBased</i> is set. */ public void calculateKill(){ ArrayList<Animal> enemies = new ArrayList<Animal>();; @@ -1859,6 +1859,7 @@ break; case MouseEvent.BUTTON3: showClicked = false; + clicked = null; break; } @@ -1871,12 +1872,9 @@ @SuppressWarnings("unchecked") private void processKeyPress(){ - if (keys[KeyEvent.VK_SPACE]) paused = !paused; // space = pause/unpause if (keys[KeyEvent.VK_ESCAPE]) escape = true; // escape key (used to exit) - //if (keys[37]) do something; // left if (keys[KeyEvent.VK_UP]) moveUp = true; // up = scroll up the list of sprites - //if (keys[39]) do something; // right if (keys[KeyEvent.VK_DOWN]) moveDown = true; // down = scroll down the list of sprites for (int i=0; i<10; i++){ // #0-9 = put a hazard at the current mouse location if (keys[KeyEvent.VK_0 + ((i + 1) % 10)]) dropHazard(i); @@ -2278,7 +2276,7 @@ animals.add(a); // Stats are calculated against the species name from the bundle, not from the bundle name itself, // so have to load the specs first and only then can the stats be initialised. - if (!speciesStats.contains(a.species)) speciesStats.put(a.species, new Hashtable<StatisticType,Integer>()); + if (!speciesStats.containsKey(a.species)) speciesStats.put(a.species, new Hashtable<StatisticType,Integer>()); adjustStat(a.species, StatisticType.SpeciesCount, 1);