Update of /cvsroot/macattrick/macattrick/Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16404/Test Modified Files: AllTests.m LineUpTreeLayerTest.m LineUpTreeNodeTest.m LineUpTreeTest.m PlayerTest.m PositionTest.m Added Files: PositionHeapTest.h PositionHeapTest.m Log Message: PositionHeap introduced, export function started Index: PlayerTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/PlayerTest.m,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PlayerTest.m 24 Jan 2005 20:20:42 -0000 1.14 --- PlayerTest.m 7 Feb 2005 21:16:29 -0000 1.15 *************** *** 31,34 **** --- 31,35 ---- #import "PlayerList.h" #import "AllTests.h" + #import "PositionHeap.h" @implementation PlayerTest *************** *** 103,107 **** -(void) testBestPosition { ! [self assertTrue:[[walter bestPosition] isEqual:[Position positionWithIdentifier:@"Winger Offensive"]]]; } --- 104,108 ---- -(void) testBestPosition { ! [self assertTrue:[[walter bestPosition] isEqual:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Winger Offensive"]]]; } Index: AllTests.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/AllTests.m,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AllTests.m 10 Jan 2005 21:44:05 -0000 1.18 --- AllTests.m 7 Feb 2005 21:16:28 -0000 1.19 *************** *** 36,39 **** --- 36,40 ---- #import "PlayerSortingTest.h" #import "PositionTest.h" + #import "PositionHeapTest.h" #import "TeamTest.h" #import "HattrickOrgTest.h" *************** *** 68,71 **** --- 69,73 ---- [self addTest:[TestSuite suiteWithClass:[PlayerSortingTest class]]]; [self addTest:[TestSuite suiteWithClass:[PositionTest class]]]; + [self addTest:[TestSuite suiteWithClass:[PositionHeapTest class]]]; [self addTest:[TestSuite suiteWithClass:[LineUpTreeNodeTest class]]]; [self addTest:[TestSuite suiteWithClass:[LineUpTreeLayerTest class]]]; Index: LineUpTreeLayerTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/LineUpTreeLayerTest.m,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LineUpTreeLayerTest.m 24 Jan 2005 20:20:40 -0000 1.4 --- LineUpTreeLayerTest.m 7 Feb 2005 21:16:28 -0000 1.5 *************** *** 28,32 **** #import "LineUpTreeLayerTest.h" ! @implementation LineUpTreeLayerTest --- 28,32 ---- #import "LineUpTreeLayerTest.h" ! #import "PositionHeap.h" @implementation LineUpTreeLayerTest *************** *** 55,61 **** [player3 setExperience:1]; [player3 setPlayerForm:8]; ! position1 = [Position positionWithIdentifier:@"Keeper"]; ! position2 = [Position positionWithIdentifier:@"Inner Midfield"]; ! position3 = [Position positionWithIdentifier:@"Forward"]; rootLayer = [[LineUpTreeLayer alloc] initWithTreshold: 0 position: nil]; LineUpTreeNode *node = [[LineUpTreeNode alloc] initWithPlayer:nil --- 55,61 ---- [player3 setExperience:1]; [player3 setPlayerForm:8]; ! position1 = [[PositionHeap uniqueInstance] positionWithIdentifier:@"Keeper"]; ! position2 = [[PositionHeap uniqueInstance] positionWithIdentifier:@"Inner Midfield"]; ! position3 = [[PositionHeap uniqueInstance] positionWithIdentifier:@"Forward"]; rootLayer = [[LineUpTreeLayer alloc] initWithTreshold: 0 position: nil]; LineUpTreeNode *node = [[LineUpTreeNode alloc] initWithPlayer:nil --- NEW FILE: PositionHeapTest.m --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick is free software; you can redistribute it and/or // // modify it under the terms of the GNU General Public License // // as published by the Free Software Foundation; either version 2 // // of the License, or (at your option) any later version. // // // // Macattrick is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place - Suite 330, // // Boston, MA 02111-1307, USA. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import "PositionHeapTest.h" @implementation PositionHeapTest -(void) testPossiblePositions { NSArray *possiblePositions = [[PositionHeap uniqueInstance] possiblePositions]; [self assertInt:[possiblePositions count] equals:18]; [self assertTrue:[possiblePositions containsObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Inner Midfield Towards Wing"]]]; } @end Index: PositionTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/PositionTest.m,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PositionTest.m 6 Feb 2005 19:36:51 -0000 1.8 --- PositionTest.m 7 Feb 2005 21:16:29 -0000 1.9 *************** *** 28,38 **** #import "PositionTest.h" ! @implementation PositionTest - (void) setUp { ! positionKeeper = [Position defaultPositionWithIdentifier:@"Keeper"]; ! positionWinger = [Position defaultPositionWithIdentifier:@"Winger"]; player1 = [[Player alloc] init]; [player1 setStaminaSkill: 6 keeperSkill: 6 --- 28,38 ---- #import "PositionTest.h" ! #import "PositionHeap.h" @implementation PositionTest - (void) setUp { ! positionKeeper = [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Keeper"]; ! positionWinger = [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger"]; player1 = [[Player alloc] init]; [player1 setStaminaSkill: 6 keeperSkill: 6 *************** *** 53,126 **** - (void) testPositionKeeper{ ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Keeper"]] equals: 6 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Keeper"]] equals: 1 precision:0.1]; } - (void) testPositionCentralDefender { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender"]] equals: 3.5 precision:0.1]; } - (void) testPositionCentralDefenderTowardsWing { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender Towards Wing"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender Towards Wing"]] equals: 3.5 precision:0.1]; } - (void) testPositionCentralDefenderOffensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender Offensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Central Defender Offensive"]] equals: 3.9 precision:0.1]; } - (void) testPositionWingBack { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback"]] equals: 3.6 precision:0.1]; } - (void) testPositionWingBackTowardsMiddle { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Towards Middle"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Towards Middle"]] equals: 3.6 precision:0.1]; } - (void) testPositionWingBackDefensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Defensive"]] equals: 1.3 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Defensive"]] equals: 3.3 precision:0.1]; } - (void) testPositionWingBackOffensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Offensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Wingback Offensive"]] equals: 4.2 precision:0.1]; } - (void) testPositionInnerMidfield { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield"]] equals: 2.3 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield"]] equals: 6.5 precision:0.1]; } - (void) testPositionInnerMidfieldTowardsWing { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Towards Wing"]] equals: 2 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Towards Wing"]] equals: 5.8 precision:0.1]; } - (void) testPositionInnerMidfieldOffensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Offensive"]] equals: 2 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Offensive"]] equals: 6.3 precision:0.1]; } - (void) testPositionInnerMidfieldDefensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Defensive"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Inner Midfield Defensive"]] equals: 6.1 precision:0.1]; } - (void) testPositionWinger { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger"]] equals: 5.3 precision:0.1]; } - (void) testPositionWingerTowardsMiddle { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Towards Middle"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Towards Middle"]] equals: 5.4 precision:0.1]; } - (void) testPositionWingerOffensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Offensive"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Offensive"]] equals: 4.9 precision:0.1]; } - (void) testPositionWingerDefensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Defensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Winger Defensive"]] equals: 4.8 precision:0.1]; } - (void) testPositionForward { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Forward"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Forward"]] equals: 4 precision:0.1]; } - (void) testPositionForwardDefensive { ! [self assertFloat:[player1 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Forward Defensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [Position defaultPositionWithIdentifier:@"Forward Defensive"]] equals: 4.5 precision:0.1]; } - (void) testCopy { --- 53,126 ---- - (void) testPositionKeeper{ ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Keeper"]] equals: 6 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Keeper"]] equals: 1 precision:0.1]; } - (void) testPositionCentralDefender { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender"]] equals: 3.5 precision:0.1]; } - (void) testPositionCentralDefenderTowardsWing { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender Towards Wing"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender Towards Wing"]] equals: 3.5 precision:0.1]; } - (void) testPositionCentralDefenderOffensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender Offensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Central Defender Offensive"]] equals: 3.9 precision:0.1]; } - (void) testPositionWingBack { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback"]] equals: 3.6 precision:0.1]; } - (void) testPositionWingBackTowardsMiddle { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Towards Middle"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Towards Middle"]] equals: 3.6 precision:0.1]; } - (void) testPositionWingBackDefensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Defensive"]] equals: 1.3 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Defensive"]] equals: 3.3 precision:0.1]; } - (void) testPositionWingBackOffensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Offensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Wingback Offensive"]] equals: 4.2 precision:0.1]; } - (void) testPositionInnerMidfield { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield"]] equals: 2.3 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield"]] equals: 6.5 precision:0.1]; } - (void) testPositionInnerMidfieldTowardsWing { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Towards Wing"]] equals: 2 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Towards Wing"]] equals: 5.8 precision:0.1]; } - (void) testPositionInnerMidfieldOffensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Offensive"]] equals: 2 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Offensive"]] equals: 6.3 precision:0.1]; } - (void) testPositionInnerMidfieldDefensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Defensive"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Inner Midfield Defensive"]] equals: 6.1 precision:0.1]; } - (void) testPositionWinger { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger"]] equals: 5.3 precision:0.1]; } - (void) testPositionWingerTowardsMiddle { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Towards Middle"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Towards Middle"]] equals: 5.4 precision:0.1]; } - (void) testPositionWingerOffensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Offensive"]] equals: 1.8 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Offensive"]] equals: 4.9 precision:0.1]; } - (void) testPositionWingerDefensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Defensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Winger Defensive"]] equals: 4.8 precision:0.1]; } - (void) testPositionForward { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Forward"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Forward"]] equals: 4 precision:0.1]; } - (void) testPositionForwardDefensive { ! [self assertFloat:[player1 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Forward Defensive"]] equals: 1.5 precision:0.1]; ! [self assertFloat:[player2 calculatePositionValue: [[PositionHeap uniqueInstance] defaultPositionWithIdentifier:@"Forward Defensive"]] equals: 4.5 precision:0.1]; } - (void) testCopy { *************** *** 139,152 **** } -(void) testIsEqual { ! [self assertTrue:[positionKeeper isEqual: [Position positionWithIdentifier:@"Keeper"]]]; ! [self assertFalse:[positionKeeper isEqual: [Position positionWithIdentifier:@"Winger"]]]; ! [self assertTrue:[positionWinger isEqual: [Position positionWithIdentifier:@"Winger"]]]; } - -(void) testPossiblePositions { - NSArray *possiblePositions = [Position possiblePositions]; - [self assertInt:[possiblePositions count] equals:18]; - [self assertTrue:[possiblePositions containsObject:[Position positionWithIdentifier:@"Inner Midfield Towards Wing"]]]; - } @end --- 139,147 ---- } -(void) testIsEqual { ! [self assertTrue:[positionKeeper isEqual: [[PositionHeap uniqueInstance] positionWithIdentifier:@"Keeper"]]]; ! [self assertFalse:[positionKeeper isEqual: [[PositionHeap uniqueInstance] positionWithIdentifier:@"Winger"]]]; ! [self assertTrue:[positionWinger isEqual: [[PositionHeap uniqueInstance] positionWithIdentifier:@"Winger"]]]; } @end Index: LineUpTreeNodeTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/LineUpTreeNodeTest.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LineUpTreeNodeTest.m 24 Jan 2005 20:20:42 -0000 1.5 --- LineUpTreeNodeTest.m 7 Feb 2005 21:16:28 -0000 1.6 *************** *** 28,32 **** #import "LineUpTreeNodeTest.h" ! --- 28,32 ---- #import "LineUpTreeNodeTest.h" ! #import "PositionHeap.h" *************** *** 55,60 **** [player3 setExperience:1]; [player3 setPlayerForm:8]; ! position1 = [Position positionWithIdentifier:@"Keeper"]; ! position2 = [Position positionWithIdentifier:@"Inner Midfield"]; root = [[LineUpTreeNode alloc] initWithPlayer: player1 stillAvailablePlayers: [NSSet setWithObjects:player2, player3, nil] --- 55,60 ---- [player3 setExperience:1]; [player3 setPlayerForm:8]; ! position1 = [[PositionHeap uniqueInstance] positionWithIdentifier:@"Keeper"]; ! position2 = [[PositionHeap uniqueInstance] positionWithIdentifier:@"Inner Midfield"]; root = [[LineUpTreeNode alloc] initWithPlayer: player1 stillAvailablePlayers: [NSSet setWithObjects:player2, player3, nil] --- NEW FILE: PositionHeapTest.h --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick is free software; you can redistribute it and/or // // modify it under the terms of the GNU General Public License // // as published by the Free Software Foundation; either version 2 // // of the License, or (at your option) any later version. // // // // Macattrick is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place - Suite 330, // // Boston, MA 02111-1307, USA. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import <Cocoa/Cocoa.h> #import <ObjcUnit/ObjcUnit.h> #import "PositionHeap.h" @interface PositionHeapTest : TestCase { } @end Index: LineUpTreeTest.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/Test/LineUpTreeTest.m,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LineUpTreeTest.m 24 Jan 2005 20:20:42 -0000 1.9 --- LineUpTreeTest.m 7 Feb 2005 21:16:28 -0000 1.10 *************** *** 28,31 **** --- 28,32 ---- #import "LineUpTreeTest.h" + #import "PositionHeap.h" @interface LineUpTreeTest(Private) *************** *** 58,72 **** - (NSArray*) defaultPositions442 { NSMutableArray *positions = [NSMutableArray arrayWithCapacity:11]; ! [positions addObject:[Position positionWithIdentifier:@"Keeper"]]; ! [positions addObject:[Position positionWithIdentifier:@"Central Defender"]]; ! [positions addObject:[Position positionWithIdentifier:@"Central Defender"]]; ! [positions addObject:[Position positionWithIdentifier:@"Wingback"]]; ! [positions addObject:[Position positionWithIdentifier:@"Wingback"]]; ! [positions addObject:[Position positionWithIdentifier:@"Inner Midfield"]]; ! [positions addObject:[Position positionWithIdentifier:@"Inner Midfield"]]; ! [positions addObject:[Position positionWithIdentifier:@"Winger"]]; ! [positions addObject:[Position positionWithIdentifier:@"Winger"]]; ! [positions addObject:[Position positionWithIdentifier:@"Forward"]]; ! [positions addObject:[Position positionWithIdentifier:@"Forward"]]; return positions; } --- 59,73 ---- - (NSArray*) defaultPositions442 { NSMutableArray *positions = [NSMutableArray arrayWithCapacity:11]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Keeper"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Central Defender"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Central Defender"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Wingback"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Wingback"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Inner Midfield"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Inner Midfield"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Winger"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Winger"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Forward"]]; ! [positions addObject:[[PositionHeap uniqueInstance] positionWithIdentifier:@"Forward"]]; return positions; } |