- (void) loadRangeData {
NSString *textFilePath =
[bundle pathForResource:@
"pfhr" ofType:@
"txt"];
NSArray *quizArray =
[[NSArray alloc
] initWithArray:
[fileContents componentsSeparatedByString:@
"\n"]];
handSliderValues =
(float*
) malloc(sizeof(float) *
[quizArray count
]);
handSliderCells =
(int*
) malloc(sizeof(float) *
[quizArray count
]);
for (int i = 0; i < [quizArray count]; i++) {
temp =
(NSString*
) [quizArray objectAtIndex:i
];
atemp = [temp componentsSeparatedByString:@","];
float perc = [[atemp objectAtIndex:1] floatValue];
offset = [atemp objectAtIndex:0];
int x = 0;
int y = 0;
if ([offset length] == 3) {
// offsuit
if ([offset characterAtIndex:2] == 'o') {
x = [Card getRankInt:[offset characterAtIndex:0]];
y = [Card getRankInt:[offset characterAtIndex:1]];
} else {
y = [Card getRankInt:[offset characterAtIndex:0]];
x = [Card getRankInt:[offset characterAtIndex:1]];
}
} else {
// pair
x = [Card getRankInt:[offset characterAtIndex:0]];
y = x;
}
int ofs = (12-y) * 13 + (12-x);
handSliderCells[i] = ofs;
handSliderValues[i] = perc;
}
// [bundle release];
// [textFilePath release];
// [fileContents release];
// [quizArray release];
[temp release];
[atemp release];
// [offset release];
}