|
From: Geisschaes <gei...@us...> - 2005-05-17 01:36:22
|
Update of /cvsroot/macattrick/macattrick In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20595 Modified Files: Position.m PositionHeap.h PositionHeap.m Log Message: import bug fixed Index: Position.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Position.m,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Position.m 9 May 2005 19:48:49 -0000 1.11 --- Position.m 16 May 2005 13:31:58 -0000 1.12 *************** *** 34,37 **** --- 34,38 ---- @interface Position (Private) + - (void) setIdentifier: (NSString *) newIdentifier; - (void) setPlayerFormRate: (double) newPlayerFormRate; - (void) setExperienceRate: (double) newExperienceRate; *************** *** 86,90 **** NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray* array = [saveString componentsSeparatedByString:@"|"]; ! identifier = [array objectAtIndex:0]; [self setPlayerFormRate:[[array objectAtIndex:1]doubleValue]]; [self setExperienceRate:[[array objectAtIndex:2]doubleValue]]; --- 87,91 ---- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray* array = [saveString componentsSeparatedByString:@"|"]; ! [self setIdentifier: [array objectAtIndex:0]]; [self setPlayerFormRate:[[array objectAtIndex:1]doubleValue]]; [self setExperienceRate:[[array objectAtIndex:2]doubleValue]]; *************** *** 110,114 **** defenderRate: (double) newDefenderRate setPiecesRate: (double) newSetPiecesRate { self = [super init]; ! identifier = [newIdentifier copy]; staminaRate = newStaminaRate; keeperRate = newKeeperRate; --- 111,115 ---- defenderRate: (double) newDefenderRate setPiecesRate: (double) newSetPiecesRate { self = [super init]; ! [self setIdentifier: newIdentifier]; staminaRate = newStaminaRate; keeperRate = newKeeperRate; *************** *** 148,151 **** --- 149,159 ---- } + - (void) setIdentifier: (NSString *) newIdentifier { + [newIdentifier retain]; + [identifier release]; + identifier = newIdentifier; + } + + - (double) playerFormRate { return playerFormRate; } - (void) setPlayerFormRate: (double) newPlayerFormRate { *************** *** 428,432 **** - (void)dealloc { ! // [identifier release]; [super dealloc]; } --- 436,440 ---- - (void)dealloc { ! [identifier release]; [super dealloc]; } Index: PositionHeap.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/PositionHeap.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionHeap.m 9 May 2005 19:48:49 -0000 1.3 --- PositionHeap.m 16 May 2005 13:31:58 -0000 1.4 *************** *** 62,66 **** NSString *value = [dic valueForKey:currentKey]; Position *newPosition = [[Position alloc] initFromSaveString:value]; ! [positionsDictionary setValue: newPosition forKey: currentKey]; [newPosition release]; } --- 62,66 ---- NSString *value = [dic valueForKey:currentKey]; Position *newPosition = [[Position alloc] initFromSaveString:value]; ! [positionsDictionary setObject: newPosition forKey:currentKey]; [newPosition release]; } *************** *** 196,200 **** } ! - savePositionsToUserDefaults { NSEnumerator *en = [positionsDictionary objectEnumerator]; Position *current; --- 196,200 ---- } ! - (void) savePositionsToUserDefaults { NSEnumerator *en = [positionsDictionary objectEnumerator]; Position *current; Index: PositionHeap.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/PositionHeap.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionHeap.h 9 May 2005 19:48:49 -0000 1.3 --- PositionHeap.h 16 May 2005 13:31:58 -0000 1.4 *************** *** 56,60 **** - (void) setPosition: (Position*) position; ! - savePositionsToUserDefaults; - (void) saveToFile: (NSString *) filename; --- 56,60 ---- - (void) setPosition: (Position*) position; ! - (void) savePositionsToUserDefaults; - (void) saveToFile: (NSString *) filename; |