From: SourceForge.net <no...@so...> - 2005-08-26 12:42:57
|
Bugs item #984451, was opened at 2004-07-03 15:51 Message generated for change (Comment added) made by karianna You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=384719&aid=984451&group_id=25576 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Other Group: None Status: Open Resolution: None Priority: 5 Submitted By: Devon Jones (soulcatcher) Assigned to: Martijn Verburg (karianna) Summary: Get rid of getCurrentPC() Initial Comment: Work has been done to remove the dreaded Golbals.getCurrentPC() call from as much of the code as possible. I need someone to start pushing it up through the code. to solve this problem, what you need to do is this: if a function calls Globals.getCurrentPC() and the function already has a pc, use that. if not, add PlayerCharacter aPC to the method signature, and find everywhere that calls that fuction, and add Globals.getCurrentPC() to the call....or use an in scopt PlayerCharacter object. if we do this long enough, all the Globals.getCurrentPC() calls will finally be gone :-) ---------------------------------------------------------------------- >Comment By: Martijn Verburg (karianna) Date: 2005-08-27 00:42 Message: Logged In: YES user_id=252169 Down to about 75 instances now and getting to the stage where I can't sensibly/easily remove anymore ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2005-08-26 21:41 Message: Logged In: YES user_id=252169 OK, I'm taking this back over, hope I don't break anything :-) - K ---------------------------------------------------------------------- Comment By: Devon Jones (soulcatcher) Date: 2005-08-26 05:09 Message: Logged In: YES user_id=107647 Yes, exactly. the globally held PC causes major problems. My goal is to have the method eliminated entirely, and then jsut have the pc attached to it's tab - and upon tab switching, it's passed to functions directly. Devon ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2005-08-25 20:57 Message: Logged In: YES user_id=252169 Hi Devon, So are you saying that if a function does this: public void doSomthing() { AnotherClass anotherClass = new AnotherClass(); PlayerCharacter aPC = Globals.getCurrentPC(); if (aPC != null){ anotherClass.doSomethingElse(aPC); } } It should be changed to this? public void doSomthing(PlayerCharacter aPCFromTheCallingMethod) { AnotherClass anotherClass = new AnotherClass(); if (aPC != null){ anotherClass.doSomethingElse(aPC); } } K ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2005-08-20 03:23 Message: Logged In: YES user_id=252169 I'm assuming lodger00 is no longer working on this actively, I'll try to take this over, let me know if I should hand it back! - K ---------------------------------------------------------------------- Comment By: Ross M. Lodge (lodger00) Date: 2004-07-04 08:50 Message: Logged In: YES user_id=878641 I've deprecated Globals.getCurrentPC(). This let's me easily find instances of it; also allows anyone compiling to see the warnings -- hopefully raise the visibility of this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=384719&aid=984451&group_id=25576 |