It is currently 23 Apr 2024, 20:11
   
Text Size

Valid parameters of an effect

Post MTG Forge Related Programming Questions Here

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

Valid parameters of an effect

Postby elcnesh » 31 Jul 2014, 17:30

The more I script cards and fix bugs in effects, the more I'm thinking a documentation of the different effects and their required/allowed parameters would be helpful. I've decided to implement such a documentation using Java annotations, which has the advantage that it's implemented directly into the code. I've also implemented some logic to check the legality of each parameter value (uses regular expressions). A patch is attached.

Is this something we want? IMO we'd need documentation of these parameters at some point anyway, and this was the cleanest way I could think of. It could help detect bugs in cards without even testing them, and provide a central reference point for scripting cards (although we might need some tool to convert it to something a bit more user-friendly, rather than Java compiler-friendly).
Attachments
ParamChecker.txt
(14.12 KiB) Downloaded 157 times
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Valid parameters of an effect

Postby friarsol » 31 Jul 2014, 17:41

A lot of it is documented in the wiki (although some of the newer effects or specific effects in features haven't been updated) http://www.slightlymagic.net/wiki/Forge_API
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Valid parameters of an effect

Postby elcnesh » 31 Jul 2014, 18:19

That's pretty cool, didn't know about it. But it seems to me this isn't easily converted to something that checks these things automatically, right?
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Re: Valid parameters of an effect

Postby friarsol » 31 Jul 2014, 18:21

elcnesh wrote:That's pretty cool, didn't know about it. But it seems to me this isn't easily converted to something that checks these things automatically, right?
No, but you were under the assumption that it wasn't documented, which I was trying to correct.
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 47 guests


Who is online

In total there are 47 users online :: 0 registered, 0 hidden and 47 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 47 guests

Login Form