It is currently 18 Jul 2025, 16:26
   
Text Size

PermanentImpl and CardImpl impl getCounters() differen

Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins

PermanentImpl and CardImpl impl getCounters() differen

Postby 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
glerman
 
Posts: 3
Joined: 15 Jun 2015, 07:09
Has thanked: 0 time
Been thanked: 1 time

Re: PermanentImpl and CardImpl impl getCounters() differen

Postby 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.
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times


Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 1 guest

Main Menu

User Menu

Our Partners


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 1 guest

Login Form