It is currently 11 Sep 2025, 22:00
   
Text Size

Cleanup old functions/variables

Post MTG Forge Related Programming Questions Here

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

Cleanup old functions/variables

Postby Sloth » 14 Oct 2011, 16:50

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
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cleanup old functions/variables

Postby jeffwadsworth » 14 Oct 2011, 19:50

I will work on Cerebral Eruption right now and scratch it off the list. *DONE*
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Cleanup old functions/variables

Postby Sloth » 14 Oct 2011, 20:51

jeffwadsworth wrote:I will work on Cerebral Eruption right now and scratch it off the list. *DONE*
Thanks Jeff!
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cleanup old functions/variables

Postby slapshot5 » 30 Oct 2011, 12:40

Is the ZCTrigger class used at all, or is it a relic of the past? Does anyone know for sure?

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Cleanup old functions/variables

Postby Sloth » 30 Oct 2011, 12:50

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",...).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cleanup old functions/variables

Postby slapshot5 » 30 Oct 2011, 12:52

I know it's used. Maybe I asked the wrong question. Is it *needed* in the new Trigger system?
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Cleanup old functions/variables

Postby Sloth » 30 Oct 2011, 13:04

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cleanup old functions/variables

Postby Sloth » 29 Nov 2011, 16:06

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?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cleanup old functions/variables

Postby Doublestrike » 08 Dec 2011, 06:51

There's a few rogue packages in the SVN from Braids and Max mtg - can these be sliced out somehow, or renamed (relicensed)?
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Cleanup old functions/variables

Postby slapshot5 » 24 Dec 2011, 13:27

I think this method in ManaPool is now defunct:

Code: Select all
public final void subtractOne(final String manaStr) {
-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Cleanup old functions/variables

Postby jendave » 24 Dec 2011, 23:11

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.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Cleanup old functions/variables

Postby Doublestrike » 25 Dec 2011, 02:44

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.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Cleanup old functions/variables

Postby friarsol » 29 Dec 2011, 18:54

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?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Cleanup old functions/variables

Postby slapshot5 » 05 Jan 2012, 14:15

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
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Cleanup old functions/variables

Postby friarsol » 05 Jan 2012, 15:47

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 35 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 35 guests

Login Form