Class CardZone
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<EntityZone<? extends Entity>>,Iterable<Card>,Collection<Card>,List<Card>,CardList
This class is a
CardList that represents the Spellsource.ZonesMessage.Zones.HAND and Spellsource.ZonesMessage.Zones.DECK. It is implemented as
an EntityZone because it represents an in-game zone; i.e., an entity can only be in one zone at once.-
Field Summary
Fields inherited from class net.demilich.metastone.game.entities.EntityZone
internal, lookup, player, zoneFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds all the cards from the given list.Adds the card fluently.clone()Creates a new zone and adds a clone of all the cards to it.booleanChecks if the list has the specific reference to a card.intgetCount()Gets the size of this list.Gets the first card in this instance.booleanRemoves the specified card instance by reference.voidDeprecated.Removes the first card in this instance and sets its location toEntityLocation.UNASSIGNED, so that it can be added to another zone.booleanReplaces a card in this zone, setting the old card'sEntity.entityLocationtoEntityLocation.UNASSIGNEDso that it can be added to another zone.shuffle(XORShiftRandom random) Shuffles the instance with the given random number generator.stream()Gets theStreamAPI representation of this card list.toList()Gets aListthat references the contents of this instance.Methods inherited from class net.demilich.metastone.game.entities.EntityZone
add, compareTo, empty, exchange, get, getManaCostComparator, getPlayer, getZone, indexOf, move, move, remove, remove, set, setLookup, setPlayer, setUnchecked, size, sort, swap, uncheckedAddMethods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.demilich.metastone.game.cards.CardList
addCard, containsCard, containsCard, filtered, get, getCopy, hasCardOfType, isEmpty, iterator, peekMethods inherited from interface java.util.Collection
parallelStream, removeIf, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
Method Details
-
addCard
Description copied from interface:CardListAdds the card fluently. -
addAll
Description copied from interface:CardListAdds all the cards from the given list. -
clone
Creates a new zone and adds a clone of all the cards to it. Skips checks on the zone to prevent entities from being in two places at once. -
contains
Description copied from interface:CardListChecks if the list has the specific reference to a card. Does not use the card'sEntity.idor itsCard.getCardId(), which may be more helpful. -
getCount
public int getCount()Description copied from interface:CardListGets the size of this list. -
peekFirst
Description copied from interface:CardListGets the first card in this instance. -
remove
Description copied from interface:CardListRemoves the specified card instance by reference. -
removeAll
Deprecated.Description copied from interface:CardListRemoves all the cards from this instance. -
removeFirst
Removes the first card in this instance and sets its location toEntityLocation.UNASSIGNED, so that it can be added to another zone.- Specified by:
removeFirstin interfaceCardList- Returns:
- The card that was removed.
-
replace
Replaces a card in this zone, setting the old card'sEntity.entityLocationtoEntityLocation.UNASSIGNEDso that it can be added to another zone. -
shuffle
Description copied from interface:CardListShuffles the instance with the given random number generator.- Specified by:
shufflein interfaceCardList- Parameters:
random- AXORShiftRandominstance.
-
toList
Description copied from interface:CardListGets aListthat references the contents of this instance. -
stream
Description copied from interface:CardListGets theStreamAPI representation of this card list.- Specified by:
streamin interfaceCardList- Specified by:
streamin interfaceCollection<Card>- Returns:
- The backing list's
Collection.stream().
-