16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
17 */ |
17 */ |
18 |
18 |
19 #import "CampaignViewController.h" |
19 #import "CampaignViewController.h" |
20 #import "IniParser.h" |
20 #import "IniParser.h" |
|
21 #import "GameInterfaceBridge.h" |
21 |
22 |
22 @interface CampaignViewController () |
23 @interface CampaignViewController () |
23 @property (nonatomic, retain) NSArray *campaignMissions; |
24 @property (nonatomic, retain) NSArray *campaignMissions; |
24 @end |
25 @end |
25 |
26 |
76 } |
77 } |
77 |
78 |
78 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
79 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
79 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"campaignMissionCell" forIndexPath:indexPath]; |
80 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"campaignMissionCell" forIndexPath:indexPath]; |
80 |
81 |
81 // Configure the cell... |
|
82 cell.textLabel.text = self.campaignMissions[indexPath.row][@"Name"]; |
82 cell.textLabel.text = self.campaignMissions[indexPath.row][@"Name"]; |
83 |
83 |
84 return cell; |
84 return cell; |
85 } |
85 } |
86 |
86 |
87 /* |
|
88 #pragma mark - Table view delegate |
87 #pragma mark - Table view delegate |
89 |
88 |
90 // In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath: |
|
91 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
89 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
92 // Navigation logic may go here, for example: |
90 NSString *campaignMissionScript = self.campaignMissions[indexPath.row][@"Script"]; |
93 // Create the next view controller. |
|
94 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil]; |
|
95 |
91 |
96 // Pass the selected object to the new view controller. |
92 [GameInterfaceBridge registerCallingController:self]; |
97 |
93 [GameInterfaceBridge startCampaignMissionGameWithScript:campaignMissionScript forCampaign:self.campaignName]; |
98 // Push the view controller. |
|
99 [self.navigationController pushViewController:detailViewController animated:YES]; |
|
100 } |
94 } |
101 */ |
|
102 |
95 |
103 #pragma mark - Dealloc |
96 #pragma mark - Dealloc |
104 |
97 |
105 - (void)dealloc { |
98 - (void)dealloc { |
106 [_campaignName release]; |
99 [_campaignName release]; |