Improve documentation

This commit is contained in:
Steven Knipe 2023-11-17 02:53:43 -08:00
parent 660288dfd7
commit f44b36fad2
3 changed files with 9 additions and 10 deletions

View file

@ -159,15 +159,19 @@ public interface Ability extends Controllable, Serializable {
void addManaCostsToPay(ManaCost manaCost);
/**
* Gets a map of the cost tags (set while casting/activating) of this ability, can be null if no tags have been set yet
* does NOT return the source permanent's tags
* Gets a map of the cost tags (set while casting/activating) of this ability, can be null if no tags have been set yet.
* Does NOT return the source permanent's tags.
* You should not be using this function in implementation of cards,
* this is a backing data structure used for internal storage.
* Use CardUtil {@link mage.util.CardUtil#getSourceCostsTag getSourceCostsTag} or {@link mage.util.CardUtil#checkSourceCostsTagExists checkSourceCostsTagExists} instead
*
* @return The map of tags and corresponding objects
*/
Map<String, Object> getCostsTagMap();
/**
* Set tag to the value, initializes this ability's tags map if it is null
* Set tag for this ability to the value, initializes this ability's tags map if needed.
* Should only be used from an {@link ActivatedAbility} (including {@link SpellAbility})
*/
void setCostsTag(String tag, Object value);

View file

@ -706,11 +706,6 @@ public abstract class AbilityImpl implements Ability {
return manaCostsToPay;
}
/**
* Accessed to see what was optional/variable costs were paid
*
* @return
*/
@Override
public Map<String, Object> getCostsTagMap() {
return costsTagMap;

View file

@ -1680,13 +1680,13 @@ public final class CardUtil {
/**
* Returns the entire cost tags map of either the source ability, or the permanent source of the ability. May be null.
* Works in any moment (even before source ability activated)
* Usually you should use one of the single tag functions instead
* Usually you should use one of the single tag functions instead: getSourceCostsTag() or checkSourceCostsTagExists()
* Use this function with caution, as it directly exposes the backing data structure.
*
* @param game
* @param source
* @return the tag map (or null)
*/
//
public static Map<String, Object> getSourceCostsTagsMap(Game game, Ability source) {
Map<String, Object> costTags;
costTags = source.getCostsTagMap();