It is currently 08 Sep 2025, 04:28
   
Text Size

SpellAbility (class) - an awkward name

Post MTG Forge Related Programming Questions Here

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

SpellAbility (class) - an awkward name

Postby Max mtg » 19 Feb 2013, 05:57

As I have merged CommonDrawback into AbilitySub, I tried to put names in order, but found out that it's not that easy.

The most problematic class is SpellAbility - which is a base class for both 'spells' and 'abilities' which are different things according to both rules and the code.

Do you have any ideas on names for classes in that package (and the very package itself)? The objective is to make names as simple and informative as possible. It's somewhat unclear now that SpellAbility is "Spell or Ability" and not both at once.

Magic rules read even different statements:
111.1. A spell is a card on the stack. As the first step of being cast (see rule 601, “Casting Spells”), the card becomes a spell and is moved to the top of the stack from the zone it was in, which is usually its owner’s hand.

112.1. An ability can be one of two things:

112.1a An ability is a characteristic an object has that lets it affect the game. An object’s abilities are defined by its rules text or by the effect that created it. [...]

112.1b An ability can be an activated or triggered ability on the stack. This kind of ability is an object. [...]
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: SpellAbility (class) - an awkward name

Postby friarsol » 19 Feb 2013, 13:24

I don't find the name SpellAbility awkward. There isn't very much difference between a spell and an ability[the 121.b version] and to me there's more of a difference between a triggered ability and an activated ability then there is between a spell and an activated ability. A lot of places in the rules even use the phrase "Spell or ability" because they have so much in common.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 62 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 62 users online :: 0 registered, 0 hidden and 62 guests (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 62 guests

Login Form