Skip to content

Commit f100553

Browse files
committed
Published download manager's resumeDownloads flag in CCPackageManager.
1 parent 5c4a07f commit f100553

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

cocos2d/CCPackageManager.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
*/
2525
@property (nonatomic, readonly) NSArray *allPackages;
2626

27+
/**
28+
* If downloads should be resumed if partial downloads found
29+
* Default is YES
30+
*/
31+
@property (nonatomic) BOOL resumeDownloads;
32+
2733
/**
2834
* Package manager's delegate
2935
*/

cocos2d/CCPackageManager.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ - (id)init
5050

5151
self.downloadManager = [[CCPackageDownloadManager alloc] init];
5252
_downloadManager.delegate = self;
53+
_downloadManager.resumeDownloads = YES;
5354

5455
self.unzippingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0);
5556
}
@@ -218,6 +219,16 @@ - (void)setUnzippingQueue:(dispatch_queue_t)unzippingQueue
218219
_unzippingQueue = unzippingQueue;
219220
}
220221

222+
- (void)setResumeDownloads:(BOOL)resumeDownloads
223+
{
224+
_downloadManager.resumeDownloads = resumeDownloads;
225+
}
226+
227+
- (BOOL)resumeDownloads
228+
{
229+
return _downloadManager.resumeDownloads;
230+
}
231+
221232

222233
#pragma mark - download
223234

0 commit comments

Comments
 (0)