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

Implement [FDN] collation #13164

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Implement [FDN] collation #13164

wants to merge 11 commits into from

Conversation

tiera3
Copy link
Contributor

@tiera3 tiera3 commented Dec 19, 2024

@github-actions github-actions bot added the cards label Dec 19, 2024
@xenohedron xenohedron self-assigned this Dec 19, 2024
Copy link
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the strategies for reducing repetition where large denominators are needed.

Please apply the recommended style adjustments wherever applicable.

// 229 packs, 127 common, 78 uncommon, 19 rare/mythic, 5 borderless common/uncommon
private static final RarityConfiguration foilRuns(){
int wildNum = RandomUtil.nextInt(229);
return ( wildNum < 224 ? wildNum < 205 ? wildNum < 127 ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nested ternaries are hard to follow - can you please replace these with if/else ?

booster.addAll(rareRuns( wildRare ? 2 : 1 ).getNext().makeRun());

// 1.5% of Play Boosters features a Special Guests card displacing a common card.
if (RandomUtil.nextInt(200) <3) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style - space around operators

numCommon++;
}else if( wildNum < 9 ){
wildUncommon = true;
}else{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style - spaces before opening braces and after closing braces

private final RarityConfiguration uncommonRuns3BC = new RarityConfiguration(BBC, BCC);
private final RarityConfiguration uncommonRuns4 = new RarityConfiguration(ABBC, ABCC);
private static final RarityConfiguration uncommonRuns(int runLength){
return ( 4> runLength ? RandomUtil.nextInt(505) <454 ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: runlength < 4 is generally easier to follow than 4 > runlength. Variable before constant as a default (unless you have a strong obvious reason)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants