add Immutable Permanents for LKI#13934
Conversation
| * @param game | ||
| * @return copy of permanent with values reset | ||
| */ | ||
| default Permanent getResetPermanent(Game game) { |
There was a problem hiding this comment.
Need more explain and examples about that -- what are you trying to do in current PR and in the future changes.
Looks like you are try to find all restricted game data modification between game states or game simulations and catch it by fast fail in unit tests or by game error. Or maybe it's about alternative implementation of copyable or historical characteristics.
|
I forgot to put it in main post, but mostly related to #12506. This is to have read only permanents that actually have characteristics that were present on the battlefield. An example is the [[Excavator]] test, where if you sacrifice a basic land with [[Leyline of the Guildpact]] it only gains landwalk of the lands original type instead of all 5. |
|
Excavator - (Gatherer) (Scryfall) (EDHREC)
Leyline of the Guildpact - (Gatherer) (Scryfall) (EDHREC)
|
This adds immutable permanent interface and classes to save dynamic game state information to the Last Known Instance. Values from CardState and MageObjectAttribute are saved to the permanent copy for future reference. The permanent also blocks any modifications. Tests all pass and it looks like most instances that reference the LKI of permanents are read-only.