|
Britbot
|
Calculates the score of this island relative to a certain group by calculating how many potential points it will generate.
Implements Britbot.ITarget. Definition at line 130 of file SmartIsland.cs. {
//constant defining how far to consider enemies capturing the island
int CaptureZone = Bot.Game.GetAttackRadius();
//check if there are more enemies than we can kill
/*if (this.IsDangerousForGroup(origin) && Magic.UseBasicGlobalizing)
{
//Bot.Game.Debug("Danger--- Group " + origin.Id + " island: " + this.Id);
return null;
}*/
//calculates the minimum distance between a group and said island
int distance = Bot.Game.Distance(this.Loc, origin.FindCenter(true));
//Amount of turns it takes to capture an island
int captureTime = this.RealTimeTillCapture(Consts.ME);
//TODO this is disabled in the meanwhile because it caused us to lost
//should be taken into consideration in the score globalizing function
/*if (this.Owner == Consts.ENEMY)
captureTime *= 2;*/
//check if the island isn't already ours, if so disqualify it and return null
// if (this.Owner != Consts.ME)
return new Score(this, TargetType.Island, this.Value, this.NearbyEnemyCount(CaptureZone),
distance + captureTime, this.TurnsToEnemyCapture(origin), this.islandDensity());
return null;
}
|
1.7.6.1