// // GameModeInfo.m // Cartographic // // Created by Starla Insigna on 11/28/11. // Copyright (c) 2011 Four Island. All rights reserved. // #import "GameModeInfo.h" #import "CCNotifications.h" #import "GameMode.h" #import "GameModeManager.h" #import "TestFlight.h" @implementation GameModeInfo @synthesize name, location, numOfStars, image, unlocked, globalHighscoreKey; - (id)initWithName:(NSString*)m_name location:(NSString*)m_location numOfStars:(int)m_numOfStars imageFilename:(NSString*)m_imageFilename unlocked:(BOOL)m_unlocked gameClass:(Class)m_gameClass globalHighscoreKey:(NSString*)m_globalHighscoreKey { self = [super init]; if (nil != self) { name = m_name; location = m_location; numOfStars = m_numOfStars; image = [[UIImage alloc] initWithContentsOfFile:m_imageFilename]; globalHighscoreKey = m_globalHighscoreKey; NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; unlocked = [defaults boolForKey:[NSString stringWithFormat:@"gameModeUnlocked-%@", name]]; if (!unlocked) { unlocked = m_unlocked; } stars = (BOOL*) calloc(numOfStars, sizeof(BOOL)); for (int i=0; i