Reference · Rules, maps and records
connectedOwnfunction
Every territory of the same owner reachable from this one through that owner's own territories, in order; never the territory itself.
Import it
import { connectedOwn } from "@johnmorrisdotca/tenka";
Definition
function connectedOwn(owners: readonly TenkaOwner[], from: number, map?: TenkaMap): number[]
Parameters
| Name | Type | Description |
|---|---|---|
owners | readonly number[] | The territory owners in native map order. |
from | number | The source territory index. |
map (optional) | TenkaMap | The native world or Europe map to use. |
Returns
number[]
Every territory of the same owner reachable from this one through that owner's own territories, in order; never the territory itself.
Examples
import { connectedOwn, startTenka } from "@johnmorrisdotca/tenka";
const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(connectedOwn(game.owners,game.owners.findIndex(owner=>owner===0)));[]What it prints (run when this page was built)