protected float GetNumberOfTurnToReachTargetWithCapacities(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget) { float result = 0f; float propertyValue = unit.GetPropertyValue(SimulationProperties.BattleMaximumMovement); if (propertyValue != 0f) { result = unit.GetDistanceByGround(potentialTarget.StaticPosition) / propertyValue; } return(result); }
protected float GetRatioDistanceToAttackAndMoveRange(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget) { float result = 0f; float distanceByGround = unit.GetDistanceByGround(potentialTarget.StaticPosition); if (distanceByGround > 0f) { float propertyValue = unit.GetPropertyValue(SimulationProperties.BattleMaximumMovement); float propertyValue2 = unit.GetPropertyValue(SimulationProperties.BattleRange); result = distanceByGround / (propertyValue + propertyValue2); } return(result); }
protected bool IsTargetWithinMovementRange(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget) { float distanceByGround = unit.GetDistanceByGround(potentialTarget.StaticPosition); return(distanceByGround <= unit.GetPropertyValue(SimulationProperties.BattleMovement)); }