Page 1 of 1

Valid parameters of an effect

PostPosted: 31 Jul 2014, 17:30
by elcnesh
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).

Re: Valid parameters of an effect

PostPosted: 31 Jul 2014, 17:41
by friarsol
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

Re: Valid parameters of an effect

PostPosted: 31 Jul 2014, 18:19
by elcnesh
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?

Re: Valid parameters of an effect

PostPosted: 31 Jul 2014, 18:21
by friarsol
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.