Fixed tags cost and MageObjectReference usage (#11500)

* Fix costs tag clearing while permanent still on the battlefield
* Improved version of game.getPermanentOrLKIBattlefield with MageObjectReference
* Improve documentation
This commit is contained in:
ssk97 2023-12-01 07:24:39 -08:00 committed by GitHub
parent aea49d3c2b
commit f3e310cfd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 7 deletions

View file

@ -112,8 +112,27 @@ public interface Game extends MageItem, Serializable, Copyable<Game> {
*/
Permanent getPermanent(UUID permanentId);
/**
* Given the UUID of a permanent, this method returns the permanent. If the current game state does not contain
* a permanent with the given UUID, this method checks the last known information on the battlefield to look for it.
* <br>
* Warning: if the permanent has left the battlefield and then returned, this information might be wrong.
* Prefer usage of a MageObjectReference instead of only the UUID.
*
* @param permanentId - The UUID of the permanent
* @return permanent or permanent's LKI
*/
Permanent getPermanentOrLKIBattlefield(UUID permanentId);
/**
* Given a MageObjectReference to a permanent, this method returns the permanent. If the current game state does not
* contain that permanent, this method checks the last known information on the battlefield.
*
* @param permanentRef - A MOR to the permanent
* @return permanent or permanent's LKI
*/
Permanent getPermanentOrLKIBattlefield(MageObjectReference permanentRef);
Permanent getPermanentEntering(UUID permanentId);
Map<UUID, Permanent> getPermanentsEntering();