Class

CyclicSelect

stdtask.CyclicSelect()

indexをこれ以上減らせないときは取りうる最大値に, 逆にindexをこれ以上増やせないときは 0 にワープするようSelectを改変したもの.

Constructor

# new CyclicSelect()

Properties:
Name Type Description
index number

このオブジェクトが管理するパラメータ

active boolean

(stdgam.Sceneの意味で) このオブジェクトが有効か

View Source stdtask.js, line 308

Extends

Methods

# action(GE, index)

actionKeyとして指定したキーが押されたときに呼び出される. デフォルトでは何もしない.

Parameters:
Name Type Description
GE stdgam.GameEngine

タスク処理を実行するために使うGameEngine

index number

this.indexの値

Inherited From:

View Source stdtask.js, line 289

# addMod(a, b, m) → {number}

(a + b) の値を m で割った余りを返す. ゼロ除算のチェックなどはしない.

Parameters:
Name Type Description
a number
b number
m number

View Source stdtask.js, line 316

(a + b) % m の値

number

# bind(other)

actionやcancelの実行を指定したオブジェクトに委任する. すなわち, 以下の処理を行う.

  • other.action(GE, index) を実行するだけの関数を this.action に代入
  • other.cancel(GE, index) を実行するだけの関数を this.cancel に代入
Parameters:
Name Type Description
other Object

action/cancelの処理を委任されるオブジェクト

Inherited From:

View Source stdtask.js, line 278

# cancel(GE, index)

cancelKeyとして指定したキーが押されたときに呼び出される. デフォルトでは何もしない.

Parameters:
Name Type Description
GE stdgam.GameEngine

タスク処理を実行するために使うGameEngine

index number

this.indexの値

Inherited From:

View Source stdtask.js, line 297

# execute(GE)

1フレーム分のタスク処理を実行する. 具体的には, キー入力に応じてthis.indexを増減させたり this.action/this.cancel を実行したりする.

【注意】this.action/this.canelを実行したフレームでは, modalの設定と 無関係に必ず false を返す. なぜならば, もしこれら処理の中で タスクリストの変更が発生した場合「forループの途中で中身を変更する」のと 同じ状況が生じるためである. 後続のタスク処理をブロックすることで安全にループを抜けることができる.

Parameters:
Name Type Description
GE stdgam.GameEngine

タスク処理に用いるGameEngine

Inherited From:

View Source stdtask.js, line 243

次のいずれかの条件を満たすとき false を返す

  1. 自分より後ろのタスク処理をブロックする設定の場合
  2. このフレームにおいてthis.action や this.cancel を実行した場合

そうでないとき true を返す

# move()

k == 0 のときはthis.indexを1減らし, k == 1 のときはthis.indexを1増やす. ただし, 結果が0未満になるときは「選択肢の個数-1」に変更し, 逆に結果が「選択肢の個数以上」になるときは0にする.

Overrides:

View Source stdtask.js, line 325

# resize(n)

項目数を変更する. これによりthis.indexの値が範囲外になる場合, this.indexを max(n-1, 0) に変更する.

Parameters:
Name Type Description
n number

新しい項目数

Inherited From:

View Source stdtask.js, line 220