Now new (not rated) cards will have rating 6 (from [1;10] range) instead of previous 0 so will appear in generated decks much more often.

This commit is contained in:
magenoxx 2011-01-11 18:55:48 +03:00
parent af61a07f71
commit d62d0c78f7

View file

@ -27,6 +27,12 @@ public class CardsStorage {
private static List<String> setCodes = new ArrayList<String>(); private static List<String> setCodes = new ArrayList<String>();
private static List<Card> notImplementedCards; private static List<Card> notImplementedCards;
/**
* Rating that is given for new card.
* Ratings are in [1,10] range, so setting it high will make new cards appear more often.
*/
private static final int DEFAULT_NOT_RATED_CARD_RATING = 6;
static { static {
for (ExpansionSet set : Sets.getInstance().values()) { for (ExpansionSet set : Sets.getInstance().values()) {
setCodes.add(set.getCode()); setCodes.add(set.getCode());
@ -111,7 +117,7 @@ public class CardsStorage {
float f = 10.0f * (r - min) / (max - min); float f = 10.0f * (r - min) / (max - min);
return (int) Math.round(f); // normalize to [1..10] return (int) Math.round(f); // normalize to [1..10]
} }
return 0; return DEFAULT_NOT_RATED_CARD_RATING;
} }
private synchronized static void readRatings() { private synchronized static void readRatings() {