Page 1 of 4

Cleanup old functions/variables

PostPosted: 14 Oct 2011, 16:50
by Sloth
In order to further trim down the code, I want to hunt down some unneeded functions/variables and post them here. If someone things we still need them post here.

If you find something which is no longer needed, you can post it here.

First find: Some commands

1.ReplaceMoveToGraveyardCommand
Only used by: Cerebral Eruption (which I think is scriptable)

2. CycleCommand
not used at all.

3. addTurnFaceUpCommand
not used at all

Re: Cleanup old functions/variables

PostPosted: 14 Oct 2011, 19:50
by jeffwadsworth
I will work on Cerebral Eruption right now and scratch it off the list. *DONE*

Re: Cleanup old functions/variables

PostPosted: 14 Oct 2011, 20:51
by Sloth
jeffwadsworth wrote:I will work on Cerebral Eruption right now and scratch it off the list. *DONE*
Thanks Jeff!

Re: Cleanup old functions/variables

PostPosted: 30 Oct 2011, 12:40
by slapshot5
Is the ZCTrigger class used at all, or is it a relic of the past? Does anyone know for sure?

-slapshot5

Re: Cleanup old functions/variables

PostPosted: 30 Oct 2011, 12:50
by Sloth
slapshot5 wrote:Is the ZCTrigger class used at all, or is it a relic of the past? Does anyone know for sure?

-slapshot5
This is still used a lot. Just search for addComesIntoPlayCommand (Fading, Echo, "CARDNAME comes into play tapped",...).

Re: Cleanup old functions/variables

PostPosted: 30 Oct 2011, 12:52
by slapshot5
I know it's used. Maybe I asked the wrong question. Is it *needed* in the new Trigger system?

Re: Cleanup old functions/variables

PostPosted: 30 Oct 2011, 13:04
by Sloth
slapshot5 wrote:I know it's used. Maybe I asked the wrong question. Is it *needed* in the new Trigger system?
They should all be replaceable with static triggered abilities.

Re: Cleanup old functions/variables

PostPosted: 29 Nov 2011, 16:06
by Sloth
I've rewritten the Recover keyword and noticed the old version set a cancelCommand of a spellAbility, but getcancelCommand is never used (or the variable). Does anybody need this?

Re: Cleanup old functions/variables

PostPosted: 08 Dec 2011, 06:51
by Doublestrike
There's a few rogue packages in the SVN from Braids and Max mtg - can these be sliced out somehow, or renamed (relicensed)?

Re: Cleanup old functions/variables

PostPosted: 24 Dec 2011, 13:27
by slapshot5
I think this method in ManaPool is now defunct:

Code: Select all
public final void subtractOne(final String manaStr) {
-slapshot5

Re: Cleanup old functions/variables

PostPosted: 24 Dec 2011, 23:11
by jendave
Doublestrike wrote:There's a few rogue packages in the SVN from Braids and Max mtg - can these be sliced out somehow, or renamed (relicensed)?
They can be renamed. They cannot be relicensed. As far as I know, only Braids' code needs to be handled with care regarding license (it is dual-licensed). I inserted a license header at the top of all files in the project with the appropriate license. Make sure any file that you touch retains the proper header.

Re: Cleanup old functions/variables

PostPosted: 25 Dec 2011, 02:44
by Doublestrike
jendave wrote:Make sure any file that you touch retains the proper header.
@jendave - cheers, thanks for the reply. I probably won't do much with them, those packages just sort of irritate my OCD.

Regarding the "proper header", shouldn't all files have the same header, or something? Not sure how this works but it seems sort of half-implemented (or less).

Anyway, just throwing these ideas out there, maybe they're inconsequential.

Re: Cleanup old functions/variables

PostPosted: 29 Dec 2011, 18:54
by friarsol
I was looking at Landwalk, seeing if we can clean things up, and it seems like we might be able to convert all of the different Landwalk keywords into Static Abilities.

The current reminder text says: "This creature is unblockable as long as defending player controls a Swamp."

The only problem with this is the Legends Enchantments (Deadfall) that negate landwalking. Can anyone think of a good way of handling that?

Re: Cleanup old functions/variables

PostPosted: 05 Jan 2012, 14:15
by slapshot5
Here's the big one: What should we do with the Old GUI code? Should we start weeding it out piece-by-piece? Nobody will be able to weed it all out by themselves. But as we find unused things, should we remove them?

Or is there a reason to keep this code around?

I was looking specifically at GuiDisplay.addObservers

It comes up when I'm searching for the Observer leaks, but it never gets called. (Called from GuiDisplay constructor, but that constructor is only called wrapped with "if (Constant.Runtime.OLDGUI[0]) {", which cannot get set anymore.)

In the interest of moving forward, my vote is to remove old GUI pieces/methods as we determine it it not being used, then when we are close, we can start deleting classes.

-slapshot5

Re: Cleanup old functions/variables

PostPosted: 05 Jan 2012, 15:47
by friarsol
That's probably the right way to go. I'm all for clearing out unused classes. The main one I'd be careful around is the Multi-Blockers UI element.