Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int getCompareValue(String raceID) {
- int value = 0;
- boolean hasTerraformable = hasTerraformable(raceID);
- boolean isColonizable = isColonizable(raceID);
- double inhabitants = getCurrentInhabitants();
- double maxCurrentInhabitants = getCurrentMaxInhabitants();
- int maxInhabitantsMod = (int) (getMaxInhabitants() - maxCurrentInhabitants);
- if(isColonizable || hasTerraformable) {
- value += maxInhabitantsMod;
- if(isFree())
- value++;
- }
- if (isColonizable)
- value++;
- if (isColonizable && !hasTerraformable) //all terraformed so it's a clear colonization target
- value += 5;
- if (hasTerraformable && (inhabitants / maxCurrentInhabitants > 0.9f)) //prioritize systems that are near the current population limit
- value += 50;
- if (isColonizable && (inhabitants > 0)) //highest priority to systems which have terraformed planets and are already colonized
- value += 100;
- return value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement