Issue #167 で行われた整理を元に、リファクタリングを行った。
cerke_online のフロントエンドがやることというのは、以下の三種類しかない。
- matching: マッチングを行う
- decision: 自分側のユーザーの決断をサーバーに送り、それゆえ発生した事象を描画する
- poll: 相手側のユーザーの決断がされたかをサーバーに問い、決断が発生していたなら、それゆえ発生した事象を描画する
ということで、matching
, decision
, poll
の三つに再編成することで、見通しを大幅に改善した。
POST 先を改名。あと /slow
を二つに分割した。
before | after |
---|---|
/mainpoll | /poll/main |
/infpoll | /poll/inf |
/whethertymok/tymok | /decision/tymok |
/whethertymok/taxot | /decision/taxot |
/whethertymokpoll | /poll/whethertymok |
/slow | /decision/main |
/slow | /decision/afterhalfacceptance |
/random/entry | /matching/random/entry |
/random/poll | /matching/random |
/random/cancel | /matching/random/cancel |
/random/entry/staging | /matching/random/entry/staging |
/random/poll/staging | /matching/random/poll/staging |
/random/cancel/staging | /matching/random/cancel/staging |
/vs_cpu/entry | /matching/vs_cpu/entry |
/vs_cpu/entry/staging | /matching/vs_cpu/entry/staging |
poll
側では main
という語を NormalMove | InfAfterStep
の意味に使っていたが、一方で decision
側では NormalMove | InfAfterStep | AfterHalfAcceptance
を表すのに main
だったり空文字列だったりを用いており、統一感がなかった。ということで、 /slow
を 2 種に分割し、main
という語の語義を NormalMove | InfAfterStep
に統一した。なおこの main
という名前は非常に分かりにくいので、良い名称が提案され次第それに改名される予定である。