Skip to content

fix(Hand): treat _inactive: 2 (new player) as not playable#1

Open
OnChainMee wants to merge 2 commits intoyuga-labs:mainfrom
OnChainMee:fix/is-playable-inactive-2-new-player
Open

fix(Hand): treat _inactive: 2 (new player) as not playable#1
OnChainMee wants to merge 2 commits intoyuga-labs:mainfrom
OnChainMee:fix/is-playable-inactive-2-new-player

Conversation

@OnChainMee
Copy link
Copy Markdown

Summary

Fixes Hand.isPlayable() incorrectly treating _inactive[i] === 2 (new player) as playable.

Per HAND.md and APPENDIX_SEATING.md, _inactive: 2 means "new player" and they are inactive until next hand. Only _inactive === 0 or undefined should count as playable.

Changes

  • src/Hand.ts: In Hand.isPlayable(), only treat _inactive[i] === 0 or undefined as active; 1 (waiting/sitting out) and 2 (new player) are not playable.
  • CONTRIBUTION_FINDINGS.md: Added audit of issues, bugs, docs, and improvement ideas for future contributions.

Test

  • Fixes failing test: Hand Data Extraction > Hand.isPlayable > should treat new players (_inactive: 2) as not playable
  • npx vitest run src/__tests__/api/hand/data-extraction.test.ts passes (45 tests)

- Hand.isPlayable() was incorrectly treating _inactive[i] === 2 as active
- Per HAND.md and APPENDIX_SEATING.md, _inactive: 2 = new player (inactive until next hand)
- Only _inactive === 0 or undefined now count as playable; 1 and 2 are not
- Fixes failing test: should treat new players (_inactive: 2) as not playable
- Add CONTRIBUTION_FINDINGS.md with audit of issues, bugs, and improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant