private float GetDefenseViability(float minLineRatio) { int attackFactor = 0; if (_outpost.UnderAttack) { attackFactor = 1; } if (minLineRatio < 0) { // AI has no units on the line, we need to spawn someone return(float.MaxValue); } return(100 / _outpost.GetHealth() * defenseDecisonData.AiBaseHealthFactor + minLineRatio * defenseDecisonData.Health_dmgRatioFactor + attackFactor * defenseDecisonData.CurrentAttackFactor); }