PermanentImpl and CardImpl impl getCounters() differen
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
2 posts
• Page 1 of 1
PermanentImpl and CardImpl impl getCounters() differen
by glerman » 25 Jul 2015, 11:50
Hi,
I've implemented "Dust of Moments" which acts on both permanents and suspended cards.
Naturally I wanted to reuse the same code for both types of cards but I couldn't, this is because suspended cards aren't permanent so to gentrify I had to use the Card interface instead of the Permanent interface.
That's when I discovered that PermanentImpl.getCounters() and CardImpl.getCounters(game) don't return the same value for the same realtime permanent object.
This makes it impossible to write generic code for permanents and suspended/exiled cards, I know I can create a wrapper to handle this is one place but it might be a simple bug that can be fixed.
So what say you?
For your convenience "Dust of Moments" rule is:
Choose one - Remove two time counters from each permanent and each suspended card or put two time counters on each permanent with a time counter on it and each suspended card
Thanks,
Gal Lerman
glerman
I've implemented "Dust of Moments" which acts on both permanents and suspended cards.
Naturally I wanted to reuse the same code for both types of cards but I couldn't, this is because suspended cards aren't permanent so to gentrify I had to use the Card interface instead of the Permanent interface.
That's when I discovered that PermanentImpl.getCounters() and CardImpl.getCounters(game) don't return the same value for the same realtime permanent object.
This makes it impossible to write generic code for permanents and suspended/exiled cards, I know I can create a wrapper to handle this is one place but it might be a simple bug that can be fixed.
So what say you?
For your convenience "Dust of Moments" rule is:
Choose one - Remove two time counters from each permanent and each suspended card or put two time counters on each permanent with a time counter on it and each suspended card
Thanks,
Gal Lerman
glerman
Re: PermanentImpl and CardImpl impl getCounters() differen
by LevelX » 25 Jul 2015, 18:28
Valid point.
I added getCounters(Game game) in PermanentImpl.
This should work for your purpose.
I guess we should deprecate PermanentImpl.getCounters(), but I have to check this more in detail.
I added getCounters(Game game) in PermanentImpl.
This should work for your purpose.
I guess we should deprecate PermanentImpl.getCounters(), but I have to check this more in detail.
-
LevelX - DEVELOPER
- Posts: 1677
- Joined: 08 Dec 2011, 15:08
- Has thanked: 174 times
- Been thanked: 374 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest