-
Notifications
You must be signed in to change notification settings - Fork 783
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
base: master
Are you sure you want to change the base?
Implement [FDN] collation #13164
Conversation
There was a problem hiding this 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 ? |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do. (I used the ternaries because I found long if else structures confusing, but each to their own I guess.)
Sorry I didn't notice these comments earlier.
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) { |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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 ? |
There was a problem hiding this comment.
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)
including nested ternaries -> if else if else
#13160