landInDirection関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The territory a key moves to from another: the nearest counter in that
direction, a little straighter being better than a little nearer, and only
among those inside view (the whole map when none is given), so that the
focus never leaves what is on the screen. Null when nothing lies that way.
インポート
import { landInDirection } from "@johnmorrisdotca/tenka/ui";
定義
function landInDirection(from: number, arrow: TenkaArrow, map?: TenkaMapKey, view?: TenkaView): number | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
from | number | The source territory index. |
arrow | TenkaArrow | The keyboard navigation direction. |
map (省略可) | TenkaMapKey | The native world or Europe map to use. |
view (省略可) | TenkaView | undefined | The visible map bounds; the full map when omitted. |
戻り値
number | null
The nearest territory in the direction and view, or null when none is available.
例
import { landInDirection } from "@johnmorrisdotca/tenka/ui";
console.log(landInDirection(0,"right"));1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。