# Barrack Settlement::BestBarrack(int)

[Family: Settlement](/imperivm/en/CKS/familias/settlement/)

## Exact signature

```text
Barrack Settlement::BestBarrack(int)
```

## Description

Selects an eligible barracks in the settlement with the lowest score accepted by its selection procedure. Returns an invalid reference if no candidate is selected.

## Usage notes

Selection filters settlement members and excludes barracks in a particular state. The exact meaning of that state, the score, and the integer argument is not fully documented; this entry does not identify them as distance, level, or unit count.

## Parameters and return type

**Return type:** `Barrack`

The member is called on an object. Its receiver is not repeated among this signature’s arguments.

| Position | Type |
| --- | --- |
| 1 | `int` |

## Read and share

- [Markdown](/imperivm/exports/en/cks/api-e52da809a96231.md)
- [JSON](/imperivm/CKS/api/entries/api-e52da809a96231?lang=en)

Keep the notes and limitations when reusing this description. Do not infer undocumented parameter meanings, units or effects.
