mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
rename a method (getCount => size) to be more uniform with java data structures
This commit is contained in:
@@ -51,7 +51,7 @@ public class CardCollections {
|
||||
this.scheme = new StorageImmediatelySerialized<Deck>(new DeckSerializer(new File(NewConstants.DECK_SCHEME_DIR)));
|
||||
this.plane = new StorageImmediatelySerialized<Deck>(new DeckSerializer(new File(NewConstants.DECK_PLANE_DIR)));
|
||||
|
||||
System.out.printf("Read decks: %d constructed, %d sealed, %d draft, %d cubes, %d scheme, %d planar.%n", constructed.getCount(), sealed.getCount(), draft.getCount(), cube.getCount(), scheme.getCount(), plane.getCount());
|
||||
System.out.printf("Read decks: %d constructed, %d sealed, %d draft, %d cubes, %d scheme, %d planar.%n", constructed.size(), sealed.size(), draft.size(), cube.size(), scheme.size(), plane.size());
|
||||
|
||||
// remove this after most people have been switched to new layout
|
||||
final OldDeckParser oldParser = new OldDeckParser(this.constructed, this.draft, this.sealed, this.cube);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class DeckgenUtil {
|
||||
/** @return {@link forge.deck.Deck} */
|
||||
public static Deck getRandomCustomDeck() {
|
||||
final IStorage<Deck> allDecks = Singletons.getModel().getDecks().getConstructed();
|
||||
final int rand = (int) (Math.floor(Math.random() * allDecks.getCount()));
|
||||
final int rand = (int) (Math.floor(Math.random() * allDecks.size()));
|
||||
final String name = allDecks.getNames().toArray(new String[0])[rand];
|
||||
return allDecks.get(name);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class QuestDeckMap implements IStorage<Deck> {
|
||||
* @see forge.util.IStorageView#getCount()
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
public int size() {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,6 @@ public interface IStorageView<T> extends Iterable<T> {
|
||||
*
|
||||
* @return the count
|
||||
*/
|
||||
int getCount();
|
||||
int size();
|
||||
|
||||
}
|
||||
|
||||
@@ -77,16 +77,6 @@ public class StorageView<T> implements IStorageView<T> {
|
||||
return this.map;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see forge.deck.IFolderMapView#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return this.map.values().iterator();
|
||||
@@ -101,7 +91,7 @@ public class StorageView<T> implements IStorageView<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
public int size() {
|
||||
return this.map.size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user