Skip to content

Commit 159a3b0

Browse files
committed
CCPackage private header added to make properties accessible internally.
1 parent 257f3af commit 159a3b0

File tree

4 files changed

+53
-14
lines changed

4 files changed

+53
-14
lines changed

cocos2d-ios.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@
600600
E0F924721224140400EF2362 /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E0F924701224140400EF2362 /* CCTexturePVR.m */; };
601601
E0F92AC41224559800EF2362 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E0F92AC31224559800EF2362 /* CCNS.h */; };
602602
E525F0F74C7C69C4371E20EE /* CCPackageHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E525F9EA4B5DD37D0418869E /* CCPackageHelper.m */; };
603+
E525F3A2BBCBB446B67D8260 /* CCPackage_private.h in Headers */ = {isa = PBXBuildFile; fileRef = E525FE4C98BCF1228ECC9623 /* CCPackage_private.h */; };
603604
E525FCC2CF72D3667DE4D71B /* CCPackageHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = E525FF8C7C018BF691F36044 /* CCPackageHelper.h */; };
604605
FC39962219C3BBCF00C93E5E /* libObjectAL (Android).a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC39961F19C3B92F00C93E5E /* libObjectAL (Android).a */; };
605606
FC64014019C79716003E595A /* libObjectAL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC39961B19C3B92F00C93E5E /* libObjectAL.a */; };
@@ -1077,6 +1078,7 @@
10771078
E0F924701224140400EF2362 /* CCTexturePVR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexturePVR.m; sourceTree = "<group>"; };
10781079
E0F92AC31224559800EF2362 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNS.h; sourceTree = "<group>"; };
10791080
E525F9EA4B5DD37D0418869E /* CCPackageHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPackageHelper.m; sourceTree = "<group>"; };
1081+
E525FE4C98BCF1228ECC9623 /* CCPackage_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPackage_private.h; sourceTree = "<group>"; };
10801082
E525FF8C7C018BF691F36044 /* CCPackageHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPackageHelper.h; sourceTree = "<group>"; };
10811083
FC39961319C3B92F00C93E5E /* ObjectAL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ObjectAL.xcodeproj; path = external/ObjectAL/ObjectAL/ObjectAL.xcodeproj; sourceTree = "<group>"; };
10821084
FC55599F1991A26300E29CCE /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "external/ogg/android/ogg/build/Debug-android/libogg.a"; sourceTree = "<group>"; };
@@ -1541,6 +1543,7 @@
15411543
83E1A85819C8AC65000A3BCA /* Install */,
15421544
E525FF8C7C018BF691F36044 /* CCPackageHelper.h */,
15431545
E525F9EA4B5DD37D0418869E /* CCPackageHelper.m */,
1546+
E525FE4C98BCF1228ECC9623 /* CCPackage_private.h */,
15441547
);
15451548
name = Packages;
15461549
sourceTree = "<group>";
@@ -2041,6 +2044,7 @@
20412044
B78AE46C17E7AF6C0028BE0B /* UITouch+CC.h in Headers */,
20422045
B7D2730F1822F4AA0054849B /* CCBKeyframe.h in Headers */,
20432046
E525FCC2CF72D3667DE4D71B /* CCPackageHelper.h in Headers */,
2047+
E525F3A2BBCBB446B67D8260 /* CCPackage_private.h in Headers */,
20442048
);
20452049
runOnlyForDeploymentPostprocessing = 0;
20462050
};

cocos2d/CCPackage.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,36 @@
3030
*/
3131
@property (nonatomic, copy, readonly) NSURL *installURL;
3232

33+
/**
34+
* Local URL of the download file when download finishes. While downloading a temp name
35+
* is used which won't be accessible.
36+
*/
37+
@property (nonatomic, copy, readonly) NSURL *localDownloadURL;
38+
39+
/**
40+
* Local URL of the folder the package is unzipped to
41+
*/
42+
@property (nonatomic, copy, readonly) NSURL *unzipURL;
43+
44+
/**
45+
* Name of the folder inside the unzip folder. A zipped package is supposed to contain a folder named
46+
* like this <NAME>-<OS>-<RESOLUTION>. Example: DLC-iOS-phonehd.
47+
* This name can vary though and can be determined by delegation if a standard name was not found
48+
* during installation.
49+
*/
50+
@property (nonatomic, copy, readonly) NSString *folderName;
51+
52+
/**
53+
* Whether or not the the package should be enabled in cocos2d after installation.
54+
*/
55+
@property (nonatomic, readonly) BOOL enableOnDownload;
56+
3357
/**
3458
* The current status of the package
3559
*/
3660
@property (nonatomic, readonly) CCPackageStatus status;
3761

62+
3863
/**
3964
* Creates a new instance of a package.
4065
* OS and resolution are determined implicitly. Resolution is derived from CCFileUtils' searchResolutionsOrder first entry.

cocos2d/CCPackage.m

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#import <MacTypes.h>
1+
#import <Foundation/Foundation.h>
22
#import "CCPackage.h"
33
#import "CCPackageHelper.h"
4+
#import "CCPackage_private.h"
45

56
static NSUInteger PACKAGE_SERIALIZATION_VERSION = 1;
67
static NSString *const PACKAGE_SERIALIZATION_KEY_NAME = @"name";
@@ -10,19 +11,10 @@
1011
static NSString *const PACKAGE_SERIALIZATION_KEY_INSTALL_URL = @"installURL";
1112
static NSString *const PACKAGE_SERIALIZATION_KEY_VERSION = @"version";
1213
static NSString *const PACKAGE_SERIALIZATION_KEY_STATUS = @"status";
13-
14-
15-
@interface CCPackage()
16-
17-
@property (nonatomic, copy, readwrite) NSString *name;
18-
@property (nonatomic, copy, readwrite) NSString *resolution;
19-
@property (nonatomic, copy, readwrite) NSString *os;
20-
@property (nonatomic, copy, readwrite) NSURL *remoteURL;
21-
@property (nonatomic, copy, readwrite) NSString *folderName;
22-
@property (nonatomic, copy, readwrite) NSURL *installURL;
23-
@property (nonatomic, readwrite) CCPackageStatus status;
24-
25-
@end
14+
static NSString *const PACKAGE_SERIALIZATION_KEY_LOCAL_DOWNLOAD_URL = @"localDownloadURL";
15+
static NSString *const PACKAGE_SERIALIZATION_KEY_LOCAL_UNZIP_URL = @"localUnzipURL";
16+
static NSString *const PACKAGE_SERIALIZATION_KEY_FOLDER_NAME = @"folderName";
17+
static NSString *const PACKAGE_SERIALIZATION_KEY_ENABLE_ON_DOWNLOAD = @"enableOnDownload";
2618

2719

2820
@implementation CCPackage

cocos2d/CCPackage_private.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#import <Foundation/Foundation.h>
2+
#import "CCPackageTypes.h"
3+
#import "CCPackage.h"
4+
5+
@interface CCPackage()
6+
7+
@property (nonatomic, copy, readwrite) NSString *name;
8+
@property (nonatomic, copy, readwrite) NSString *resolution;
9+
@property (nonatomic, copy, readwrite) NSString *os;
10+
@property (nonatomic, copy, readwrite) NSURL *remoteURL;
11+
@property (nonatomic, copy, readwrite) NSString *folderName;
12+
@property (nonatomic, copy, readwrite) NSURL *installURL;
13+
@property (nonatomic, copy, readwrite) NSURL *localDownloadURL;
14+
@property (nonatomic, copy, readwrite) NSURL *unzipURL;
15+
@property (nonatomic, readwrite) BOOL enableOnDownload;
16+
@property (nonatomic, readwrite) CCPackageStatus status;
17+
18+
@end

0 commit comments

Comments
 (0)