Page 1 of 1

PermanentImpl and CardImpl impl getCounters() differen

PostPosted: 25 Jul 2015, 11:50
by glerman
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

Re: PermanentImpl and CardImpl impl getCounters() differen

PostPosted: 25 Jul 2015, 18:28
by LevelX
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.