Commit 3d01367c authored by Chengzhao Li's avatar Chengzhao Li
Browse files

- add interface class and functions

parent 2b08f4d9
......@@ -63,6 +63,16 @@
927F61B9196C771E000F43EF /* iPhone@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B71F590E188484E7003F4D28 /* iPhone@2x.png */; };
927F61BA196C771E000F43EF /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = B737896D180762440076A88C /* Default.png */; };
927F61BB196C771E000F43EF /* iPad-old.png in Resources */ = {isa = PBXBuildFile; fileRef = B71F5907188484E7003F4D28 /* iPad-old.png */; };
9B1F83C61D19AEEF00837DA1 /* NCMCCentralService.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83BC1D19AEEF00837DA1 /* NCMCCentralService.m */; };
9B1F83C71D19AEEF00837DA1 /* NCMCPeerID.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83BD1D19AEEF00837DA1 /* NCMCPeerID.m */; };
9B1F83C81D19AEEF00837DA1 /* NCMCPeripheralService.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83BE1D19AEEF00837DA1 /* NCMCPeripheralService.m */; };
9B1F83C91D19AEEF00837DA1 /* NCMCSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83BF1D19AEEF00837DA1 /* NCMCSession.m */; };
9B1F83CD1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83CC1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m */; };
9B1F83CE1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83CC1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m */; };
9B1F83CF1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83CC1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m */; };
9B1F83DC1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83DB1D19CFCE00837DA1 /* NCMCMessageData.m */; };
9B1F83DD1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83DB1D19CFCE00837DA1 /* NCMCMessageData.m */; };
9B1F83DE1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F83DB1D19CFCE00837DA1 /* NCMCMessageData.m */; };
9B6B1ED11D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
9B6B1ED21D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
9B6B1ED31D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
......@@ -72,6 +82,9 @@
9B6B1EDB1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EDC1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EDD1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EEC1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
9B6B1EED1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
9B6B1EEE1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
B71F5911188484E7003F4D28 /* iPad-old.png in Resources */ = {isa = PBXBuildFile; fileRef = B71F5907188484E7003F4D28 /* iPad-old.png */; };
B71F5912188484E7003F4D28 /* iPad-old@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B71F5908188484E7003F4D28 /* iPad-old@2x.png */; };
B71F5913188484E7003F4D28 /* iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = B71F5909188484E7003F4D28 /* iPad.png */; };
......@@ -182,12 +195,30 @@
7BF6AF9F1A425F9800FFF9BA /* JavaFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaFoundation.framework; path = "../../../../../../../Library/SBAndroid/Application Support/Developer/Shared/Xcode/Platforms/Android.platform/Developer/SDKs/SBAndroid.sdk/System/Library/Frameworks/JavaFoundation.framework"; sourceTree = "<group>"; };
8392007918EE8E3300B6C429 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
927F61BF196C771E000F43EF /* NCMultipeerConnectivity Android.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NCMultipeerConnectivity Android.app"; sourceTree = BUILT_PRODUCTS_DIR; };
9B1F83BC1D19AEEF00837DA1 /* NCMCCentralService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCCentralService.m; path = Source/NCMultipeerConnectiviy/NCMCCentralService.m; sourceTree = "<group>"; };
9B1F83BD1D19AEEF00837DA1 /* NCMCPeerID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCPeerID.m; path = Source/NCMultipeerConnectiviy/NCMCPeerID.m; sourceTree = "<group>"; };
9B1F83BE1D19AEEF00837DA1 /* NCMCPeripheralService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCPeripheralService.m; path = Source/NCMultipeerConnectiviy/NCMCPeripheralService.m; sourceTree = "<group>"; };
9B1F83BF1D19AEEF00837DA1 /* NCMCSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCSession.m; path = Source/NCMultipeerConnectiviy/NCMCSession.m; sourceTree = "<group>"; };
9B1F83C11D19AEEF00837DA1 /* NCMCCentralService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCCentralService.h; path = Source/NCMultipeerConnectiviy/NCMCCentralService.h; sourceTree = "<group>"; };
9B1F83C21D19AEEF00837DA1 /* NCMCPeerID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCPeerID.h; path = Source/NCMultipeerConnectiviy/NCMCPeerID.h; sourceTree = "<group>"; };
9B1F83C31D19AEEF00837DA1 /* NCMCPeripheralService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCPeripheralService.h; path = Source/NCMultipeerConnectiviy/NCMCPeripheralService.h; sourceTree = "<group>"; };
9B1F83C41D19AEEF00837DA1 /* NCMCSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCSession.h; path = Source/NCMultipeerConnectiviy/NCMCSession.h; sourceTree = "<group>"; };
9B1F83CB1D19B5AF00837DA1 /* NCMCBluetoothLEManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCBluetoothLEManager.h; path = Source/NCMultipeerConnectiviy/Core/NCMCBluetoothLEManager.h; sourceTree = "<group>"; };
9B1F83CC1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCBluetoothLEManager.m; path = Source/NCMultipeerConnectiviy/Core/NCMCBluetoothLEManager.m; sourceTree = "<group>"; };
9B1F83D01D19B83800837DA1 /* NCMCSession+Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NCMCSession+Core.h"; path = "Source/NCMultipeerConnectiviy/Core/NCMCSession+Core.h"; sourceTree = "<group>"; };
9B1F83D51D19BAAD00837DA1 /* NCMCCentralService+Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NCMCCentralService+Core.h"; path = "Source/NCMultipeerConnectiviy/Core/NCMCCentralService+Core.h"; sourceTree = "<group>"; };
9B1F83DA1D19CFCE00837DA1 /* NCMCMessageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCMessageData.h; path = Source/NCMultipeerConnectiviy/Core/NCMCMessageData.h; sourceTree = "<group>"; };
9B1F83DB1D19CFCE00837DA1 /* NCMCMessageData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCMessageData.m; path = Source/NCMultipeerConnectiviy/Core/NCMCMessageData.m; sourceTree = "<group>"; };
9B1F83DF1D19D5E100837DA1 /* NCMCPeripheralService+Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NCMCPeripheralService+Core.h"; path = "Source/NCMultipeerConnectiviy/Core/NCMCPeripheralService+Core.h"; sourceTree = "<group>"; };
9B6B1ECF1D18944F0008B45D /* LoginScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoginScene.h; path = Source/LoginScene.h; sourceTree = "<group>"; };
9B6B1ED01D18944F0008B45D /* LoginScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LoginScene.m; path = Source/LoginScene.m; sourceTree = "<group>"; };
9B6B1ED41D1895860008B45D /* SettingScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SettingScene.h; path = Source/SettingScene.h; sourceTree = "<group>"; };
9B6B1ED51D1895860008B45D /* SettingScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SettingScene.m; path = Source/SettingScene.m; sourceTree = "<group>"; };
9B6B1ED91D1895A50008B45D /* ConnectionScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionScene.h; path = Source/ConnectionScene.h; sourceTree = "<group>"; };
9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ConnectionScene.m; path = Source/ConnectionScene.m; sourceTree = "<group>"; };
9B6B1EE41D1898340008B45D /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Parameters.h; path = Source/Parameters.h; sourceTree = "<group>"; };
9B6B1EEA1D1899850008B45D /* MultiplayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiplayerController.h; path = Source/MultiplayerController.h; sourceTree = "<group>"; };
9B6B1EEB1D1899850008B45D /* MultiplayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MultiplayerController.m; path = Source/MultiplayerController.m; sourceTree = "<group>"; };
B71F5907188484E7003F4D28 /* iPad-old.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "iPad-old.png"; path = "Icons/iPad-old.png"; sourceTree = "<group>"; };
B71F5908188484E7003F4D28 /* iPad-old@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "iPad-old@2x.png"; path = "Icons/iPad-old@2x.png"; sourceTree = "<group>"; };
B71F5909188484E7003F4D28 /* iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = iPad.png; path = Icons/iPad.png; sourceTree = "<group>"; };
......@@ -448,11 +479,23 @@
name = libs;
sourceTree = "<group>";
};
B737893C1807616C0076A88C /* Source */ = {
9B1F83CA1D19B52800837DA1 /* Core */ = {
isa = PBXGroup;
children = (
9B1F83D01D19B83800837DA1 /* NCMCSession+Core.h */,
9B1F83D51D19BAAD00837DA1 /* NCMCCentralService+Core.h */,
9B1F83DF1D19D5E100837DA1 /* NCMCPeripheralService+Core.h */,
9B1F83DA1D19CFCE00837DA1 /* NCMCMessageData.h */,
9B1F83DB1D19CFCE00837DA1 /* NCMCMessageData.m */,
9B1F83CB1D19B5AF00837DA1 /* NCMCBluetoothLEManager.h */,
9B1F83CC1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m */,
);
name = Core;
sourceTree = "<group>";
};
9B6B1EE71D1898DA0008B45D /* Scenes */ = {
isa = PBXGroup;
children = (
D352B48019EC608A00829775 /* MetalShaders */,
7A40362019DDEF0D007B6E8F /* Platforms */,
9B6B1ED41D1895860008B45D /* SettingScene.h */,
9B6B1ED51D1895860008B45D /* SettingScene.m */,
B7378992180767190076A88C /* LobbyScene.h */,
......@@ -462,6 +505,44 @@
9B6B1ED91D1895A50008B45D /* ConnectionScene.h */,
9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */,
);
name = Scenes;
sourceTree = "<group>";
};
9B6B1EE81D18990E0008B45D /* Controller */ = {
isa = PBXGroup;
children = (
9B6B1EE91D1899210008B45D /* NCMultipeerConnectiviy */,
9B6B1EEA1D1899850008B45D /* MultiplayerController.h */,
9B6B1EEB1D1899850008B45D /* MultiplayerController.m */,
);
name = Controller;
sourceTree = "<group>";
};
9B6B1EE91D1899210008B45D /* NCMultipeerConnectiviy */ = {
isa = PBXGroup;
children = (
9B1F83CA1D19B52800837DA1 /* Core */,
9B1F83C11D19AEEF00837DA1 /* NCMCCentralService.h */,
9B1F83BC1D19AEEF00837DA1 /* NCMCCentralService.m */,
9B1F83C31D19AEEF00837DA1 /* NCMCPeripheralService.h */,
9B1F83BE1D19AEEF00837DA1 /* NCMCPeripheralService.m */,
9B1F83C41D19AEEF00837DA1 /* NCMCSession.h */,
9B1F83BF1D19AEEF00837DA1 /* NCMCSession.m */,
9B1F83C21D19AEEF00837DA1 /* NCMCPeerID.h */,
9B1F83BD1D19AEEF00837DA1 /* NCMCPeerID.m */,
);
name = NCMultipeerConnectiviy;
sourceTree = "<group>";
};
B737893C1807616C0076A88C /* Source */ = {
isa = PBXGroup;
children = (
9B6B1EE41D1898340008B45D /* Parameters.h */,
D352B48019EC608A00829775 /* MetalShaders */,
7A40362019DDEF0D007B6E8F /* Platforms */,
9B6B1EE71D1898DA0008B45D /* Scenes */,
9B6B1EE81D18990E0008B45D /* Controller */,
);
name = Source;
sourceTree = "<group>";
};
......@@ -824,6 +905,9 @@
9B6B1ED31D18944F0008B45D /* LoginScene.m in Sources */,
7A59498E19E3941300F65F90 /* AppDelegate.m in Sources */,
9B6B1ED81D1895860008B45D /* SettingScene.m in Sources */,
9B1F83CF1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */,
9B1F83DE1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */,
9B6B1EEE1D1899850008B45D /* MultiplayerController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -833,7 +917,10 @@
files = (
9B6B1EDC1D1895A50008B45D /* ConnectionScene.m in Sources */,
9B6B1ED21D18944F0008B45D /* LoginScene.m in Sources */,
9B6B1EED1D1899850008B45D /* MultiplayerController.m in Sources */,
9B6B1ED71D1895860008B45D /* SettingScene.m in Sources */,
9B1F83DD1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */,
9B1F83CE1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */,
927F619E196C771E000F43EF /* LobbyScene.m in Sources */,
5B121030197484FA004C1E1D /* NCMultipeerConnectivityActivity.m in Sources */,
);
......@@ -844,11 +931,18 @@
buildActionMask = 2147483647;
files = (
B73789871807631A0076A88C /* main.m in Sources */,
9B1F83C71D19AEEF00837DA1 /* NCMCPeerID.m in Sources */,
7A046D8C19E8A20E004C4763 /* LobbyScene.m in Sources */,
9B6B1EDB1D1895A50008B45D /* ConnectionScene.m in Sources */,
9B6B1ED11D18944F0008B45D /* LoginScene.m in Sources */,
9B1F83C91D19AEEF00837DA1 /* NCMCSession.m in Sources */,
9B1F83CD1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */,
9B1F83C81D19AEEF00837DA1 /* NCMCPeripheralService.m in Sources */,
5B121038197487F2004C1E1D /* AppDelegate.m in Sources */,
9B1F83C61D19AEEF00837DA1 /* NCMCCentralService.m in Sources */,
9B6B1ED61D1895860008B45D /* SettingScene.m in Sources */,
9B6B1EEC1D1899850008B45D /* MultiplayerController.m in Sources */,
9B1F83DC1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -10,7 +10,7 @@
<false/>
</dict>
<key>UUID</key>
<integer>6</integer>
<integer>7</integer>
<key>centeredOrigin</key>
<false/>
<key>currentResolution</key>
......@@ -530,7 +530,7 @@
<key>value</key>
<array>
<real>284</real>
<real>109</real>
<real>64</real>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
......@@ -823,6 +823,215 @@
</dict>
</array>
</dict>
<dict>
<key>UUID</key>
<integer>6</integer>
<key>baseClass</key>
<string>CCLabelTTF</string>
<key>children</key>
<array/>
<key>customClass</key>
<string></string>
<key>displayName</key>
<string>CCLabelTTF</string>
<key>memberVarAssignmentName</key>
<string>lbWarninng</string>
<key>memberVarAssignmentType</key>
<integer>1</integer>
<key>properties</key>
<array>
<dict>
<key>name</key>
<string>name</string>
<key>type</key>
<string>StringSimple</string>
<key>value</key>
<string></string>
</dict>
<dict>
<key>name</key>
<string>position</string>
<key>type</key>
<string>Position</string>
<key>value</key>
<array>
<real>284</real>
<real>140</real>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>anchorPoint</string>
<key>type</key>
<string>Point</string>
<key>value</key>
<array>
<real>0.5</real>
<real>0.5</real>
</array>
</dict>
<dict>
<key>name</key>
<string>scale</string>
<key>type</key>
<string>ScaleLock</string>
<key>value</key>
<array>
<real>1</real>
<real>1</real>
<false/>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>string</string>
<key>type</key>
<string>Text</string>
<key>value</key>
<array>
<string>Sample Text</string>
<false/>
</array>
</dict>
<dict>
<key>name</key>
<string>fontName</string>
<key>type</key>
<string>FontTTF</string>
<key>value</key>
<string>Helvetica</string>
</dict>
<dict>
<key>name</key>
<string>fontSize</string>
<key>type</key>
<string>FloatScale</string>
<key>value</key>
<array>
<real>12</real>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>adjustsFontSizeToFit</string>
<key>type</key>
<string>Check</string>
<key>value</key>
<false/>
</dict>
<dict>
<key>name</key>
<string>dimensions</string>
<key>type</key>
<string>Size</string>
<key>value</key>
<array>
<real>0.0</real>
<real>0.0</real>
<integer>0</integer>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>horizontalAlignment</string>
<key>type</key>
<string>IntegerLabeled</string>
<key>value</key>
<integer>0</integer>
</dict>
<dict>
<key>name</key>
<string>verticalAlignment</string>
<key>type</key>
<string>IntegerLabeled</string>
<key>value</key>
<integer>0</integer>
</dict>
<dict>
<key>name</key>
<string>fontColor</string>
<key>type</key>
<string>Color4</string>
<key>value</key>
<array>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</dict>
<dict>
<key>name</key>
<string>outlineColor</string>
<key>type</key>
<string>Color4</string>
<key>value</key>
<array>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
</array>
</dict>
<dict>
<key>name</key>
<string>outlineWidth</string>
<key>type</key>
<string>FloatScale</string>
<key>value</key>
<array>
<real>1</real>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>shadowColor</string>
<key>type</key>
<string>Color4</string>
<key>value</key>
<array>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
</array>
</dict>
<dict>
<key>name</key>
<string>shadowBlurRadius</string>
<key>type</key>
<string>FloatScale</string>
<key>value</key>
<array>
<real>0.0</real>
<integer>0</integer>
</array>
</dict>
<dict>
<key>name</key>
<string>shadowOffset</string>
<key>type</key>
<string>Position</string>
<key>value</key>
<array>
<real>0.0</real>
<real>0.0</real>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
</array>
</dict>
</array>
<key>selected</key>
<true/>
</dict>
</array>
<key>customClass</key>
<string>LoginScene</string>
......@@ -894,8 +1103,6 @@
</array>
</dict>
</array>
<key>selected</key>
<true/>
</dict>
<key>notes</key>
<array/>
......
......@@ -7,7 +7,43 @@
//
#import "LoginScene.h"
#import "Parameters.h"
#import "MultiplayerController.h"
@implementation LoginScene
{
CCButton* btnStart;
CCTextField* tfUserName;
CCLabelTTF* lbWarninng;
}
-(void)didLoadFromCCB
{
btnStart.enabled = NO;
lbWarninng.string = [NSString stringWithFormat:@"The length of user name must be\nbetween %d and %d letters", MIN_USERNAME_LENGTH, MAX_USERNAME_LENGTH];
lbWarninng.visible = NO;
}
-(void)onBtnStartClicked
{
CCLOG(@"name = %@", tfUserName.string);
[[MultiplayerController instance]setMultiplayerDisplayName:tfUserName.string];
CCScene *serverClientScene = [CCBReader loadAsScene:@"SettingScene"];
[[CCDirector sharedDirector] replaceScene:serverClientScene];
}
-(void)onUserNameEntered:(id)sender
{
if (tfUserName.string.length >= MIN_USERNAME_LENGTH && tfUserName.string.length <= MAX_USERNAME_LENGTH) {
btnStart.enabled = YES;
lbWarninng.visible = NO;
} else {
btnStart.enabled = NO;
lbWarninng.visible = YES;
}
}
@end
//
// MultiplayerController.h
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-20.
// Copyright © 2016 Apportable. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MultiplayerController : NSObject
+ (MultiplayerController *) instance;
-(void)setMultiplayerDisplayName:(NSString*)name;
// SETUP FUNCS
- (void) initializeControllerForNewMatch;
- (void) createServerHostedGame;
- (void) joinServerHostedGame;
@end
//
// MultiplayerController.m
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-20.
// Copyright © 2016 Apportable. All rights reserved.
//
#import "MultiplayerController.h"
@implementation MultiplayerController
{
NSString *displayName;
}
static MultiplayerController *_sharedMultiplayerController = nil;
+ (MultiplayerController *)instance {
@synchronized(self) {
if (_sharedMultiplayerController == nil) {
_sharedMultiplayerController = [[MultiplayerController alloc] init];
}
}
return _sharedMultiplayerController;
}
-(void)setMultiplayerDisplayName:(NSString *)name
{
displayName = name;
}
-(void)initializeControllerForNewMatch
{
}
-(void)joinServerHostedGame
{
[self initializeControllerForNewMatch];
}
-(void)createServerHostedGame
{
[self initializeControllerForNewMatch];
}
@end
//
// NCMCBluetoothLEManager.h
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-21.
// Copyright © 2016 Apportable. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "NCMCSession+Core.h"
#import "NCMCCentralService+Core.h"
#import "NCMCPeripheralService+Core.h"
@interface NCMCBluetoothLEManager : NSObject
@property (assign, nonatomic)Boolean isCentral;
@property (strong, nonatomic)NCMCSession* session;
+(NCMCBluetoothLEManager *)instance;
-(void)disconnect;
@end
//
// NCMCBluetoothLEManager.m
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-21.
// Copyright © 2016 Apportable. All rights reserved.
//
#import "NCMCBluetoothLEManager.h"
#import "NCMCMessageData.h"
@interface NCMCBluetoothLEManager()
{
NSMutableArray<NCMCMessageData*> *recMsgArray;
// central
NSMutableArray<NCMCMessageData*> *centralDataToSend;