It is currently 29 Oct 2025, 00:50
   
Text Size

Restrictions for Card.isValidCard

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Re: Restrictions for Card.isValidCard

Postby slapshot5 » 16 Jun 2011, 14:19

In the interest of expanding isValidCard to handle things like the Echoing cards (ex. "Destroy target enchantment and all other enchantments with the same name as that enchantment."), what needs to be done? Looks to me like we just pass in the AbilityFactory object when called from an AF, and null otherwise. Then, in hasProperty, we check for null, get the targets, then check the name.

Seem reasonable?

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Restrictions for Card.isValidCard

Postby friarsol » 16 Jun 2011, 14:27

slapshot5 wrote:In the interest of expanding isValidCard to handle things like the Echoing cards (ex. "Destroy target enchantment and all other enchantments with the same name as that enchantment."), what needs to be done? Looks to me like we just pass in the AbilityFactory object when called from an AF, and null otherwise. Then, in hasProperty, we check for null, get the targets, then check the name.

Seem reasonable?
Are we passing in the AF or the SA?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Restrictions for Card.isValidCard

Postby slapshot5 » 16 Jun 2011, 20:03

Niether right now. Just (String, sourceCard, controller).

I suppose passing in the SA would be better.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 24 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 24 guests

Login Form