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
by 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).
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 156 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
by 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
by 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
by friarsol » 31 Jul 2014, 18:21
No, but you were under the assumption that it wasn't documented, which I was trying to correct.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?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests