UBCMJC / MJCApp

Website for recording MJC league games
3 stars 4 forks source link

Remove hard-coded Hong Kong point values #66

Open 0spooky2me opened 6 years ago

0spooky2me commented 6 years ago

We can modify the code to use a formula to calculate points.

Current point table is as follows: Points: Payout Payout Payout Dealin: 3: 8 8 16 4: 16 16 32 5: 24 24 48 6: 32 32 64 7: 48 48 96 8: 64 64 128 9: 96 96 192 10: 128 128 256

Selfdraw: 3: 16 16 16 4: 32 32 32 5: 48 48 48 6: 64 64 64 7: 96 96 96 8: 128 128 128 9: 192 192 192 10: 256 256 256

If we can make a simple formula for this, we can simplify our code.

Mooters commented 6 years ago

Just curious, can I see where this is implemented in the code?

Thanks

0spooky2me commented 6 years ago

@Mooters current implementation is in imports/ui/record-game/RecordHongKongGame.js

We should move it to imports/api/HandScoreCalculator.js

I recommend you follow the same pattern that was used for Japanese hands