ryuprogrammer / CheatingJanken

CoreMLを用いた後出しジャンケンゲームアプリ
1 stars 0 forks source link

#20 手の認識不可を考慮 #21

Closed ryuprogrammer closed 1 year ago

ryuprogrammer commented 1 year ago

関連Isuue番号

close #20

追加・変更の概要

ユーザーの手が識別できない時はジャンケンを行わないで「リトライ」と表示されるように変更しました。

ジャンケンのenumを変更

識別できない時のエラー用のenumを追加しました。 https://github.com/CodeCandySchool/CheatingJanken_ryu/blob/9f660bbb7aca9956c76f82ecc9c457f3304833f7/CheatingJanken/CheatingJanken/Model/HandGestureModel.swift#L14-L20

識別できているかの判定

ユーザーの手が識別できるか判定するif文を追加しました。 https://github.com/CodeCandySchool/CheatingJanken_ryu/blob/9f660bbb7aca9956c76f82ecc9c457f3304833f7/CheatingJanken/CheatingJanken/Model/HandGestureModel.swift#L64-L112

テストしたこと

実機テストした結果、正常に動作いたしました。

ryuprogrammer commented 1 year ago

@mustacheyork

newWinRateについて

newWinRateをHandGestureViewで使用しているので、@Publishして使用しました。

https://github.com/CodeCandySchool/CheatingJanken_ryu/blob/ec0e66784ec7501b7c4654f9548abd48757f79a5/CheatingJanken/CheatingJanken/View/HandGestureView.swift#L76-L81

mustacheyork commented 1 year ago

@ryuprogrammer 修正OKです 👏 マージお願いします 🎉