Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vector cards instead of tuple cards #230

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Use vector cards instead of tuple cards #230

merged 1 commit into from
Sep 4, 2023

Conversation

charleskawczynski
Copy link
Owner

This PR changes the Table and Players cards member from Union{..., Tuple{Card,...}}to Vector{Card}. The main reason this is useful is because we do mutate these cards during games (e.g., during deal), so it's a bit more ergonomic to have them be vectors than tuples.

@charleskawczynski
Copy link
Owner Author

It looks like we lose about a microsecond per play on performance, but I don't think it's a big issue. Ultimately, this will help fix #228 in a less clunky way (if we were using Tuples).

@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Merging #230 (e2a0854) into main (f9e3fb4) will increase coverage by 0.18%.
Report is 2 commits behind head on main.
The diff coverage is 70.83%.

@@            Coverage Diff             @@
##             main     #230      +/-   ##
==========================================
+ Coverage   73.35%   73.54%   +0.18%     
==========================================
  Files          17       17              
  Lines        1460     1478      +18     
==========================================
+ Hits         1071     1087      +16     
- Misses        389      391       +2     
Files Changed Coverage Δ
src/terminal/ascii_card.jl 2.94% <0.00%> (-0.29%) ⬇️
src/terminal/ui.jl 6.12% <0.00%> (ø)
src/recreate.jl 74.35% <70.00%> (+0.82%) ⬆️
src/table.jl 95.70% <75.00%> (+0.05%) ⬆️
src/game.jl 92.80% <85.71%> (-0.30%) ⬇️
src/transactions.jl 77.08% <88.88%> (+0.19%) ⬆️
src/player_type.jl 95.55% <100.00%> (+0.31%) ⬆️

... and 1 file with indirect coverage changes

@charleskawczynski
Copy link
Owner Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 4, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 9193644 into main Sep 4, 2023
18 of 19 checks passed
@bors bors bot deleted the ck/vec branch September 4, 2023 00:12
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