forked from External/mage
Add documentation to Cards and CardsImpl (#9019)
* Added minor documentation and TODO questions * Fixed typo * Address one set of comments * merge fix * remove commented code --------- Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
parent
af2d336045
commit
6b5d4abb69
58 changed files with 124 additions and 112 deletions
|
|
@ -13,17 +13,32 @@ import java.util.UUID;
|
|||
|
||||
public interface Cards extends Set<UUID>, Serializable {
|
||||
|
||||
/**
|
||||
* Add the passed in card to the set if it's not null.
|
||||
*
|
||||
* @param card the card to add
|
||||
*/
|
||||
void add(Card card);
|
||||
|
||||
/**
|
||||
* Get the Card corresponding to the UUID passed IF it is in the set.
|
||||
* Returns null if the card is not in the set
|
||||
*
|
||||
* @param cardId UUID of the card to get
|
||||
* @param game the current game
|
||||
* @return The Card corresponding to the UUID, or null if that UUID is not in the set
|
||||
*/
|
||||
Card get(UUID cardId, Game game);
|
||||
|
||||
/**
|
||||
* Remove a specific card from the set in a safe manner.
|
||||
*
|
||||
* @param card the card to remove from this set
|
||||
* @return boolean indicating if removing the card was done successfully
|
||||
*/
|
||||
boolean remove(Card card);
|
||||
|
||||
void setOwner(UUID ownerId, Game game);
|
||||
|
||||
void addAll(List<? extends Card> createCards);
|
||||
|
||||
void addAll(Set<? extends Card> createCards);
|
||||
void addAllCards(Collection<? extends Card> createCards);
|
||||
|
||||
Set<Card> getCards(Game game);
|
||||
|
||||
|
|
@ -33,6 +48,12 @@ public interface Cards extends Set<UUID>, Serializable {
|
|||
|
||||
String getValue(Game game);
|
||||
|
||||
/**
|
||||
* Get a collection view of the unique non-null cards in this set.
|
||||
*
|
||||
* @param game The current game
|
||||
* @return Collection of unique non-null cards.
|
||||
*/
|
||||
Collection<Card> getUniqueCards(Game game);
|
||||
|
||||
Card getRandom(Game game);
|
||||
|
|
@ -45,7 +66,19 @@ public interface Cards extends Set<UUID>, Serializable {
|
|||
|
||||
Cards copy();
|
||||
|
||||
/**
|
||||
* Remove all cards except those in the provided zone.
|
||||
*
|
||||
* @param zone cards from this zone will be kept.
|
||||
* @param game the ongoing game.
|
||||
*/
|
||||
void retainZone(Zone zone, Game game);
|
||||
|
||||
/**
|
||||
* Remove all cards which are in the provided zone.
|
||||
*
|
||||
* @param zone cards from this zone will be removed.
|
||||
* @param game The ongoing game.
|
||||
*/
|
||||
void removeZone(Zone zone, Game game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue