This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a CastMessageBus to handle messages for a custom namespace | |
window.messageBus = | |
window.castReceiverManager.getCastMessageBus( | |
'urn:x-cast:com.hsienwei.test2048'); | |
// handler for the CastMessageBus message event | |
window.messageBus.onMessage = function(event) { | |
console.log('Message [' + event.senderId + ']: ' + event.data); | |
if ( event.data == "continue") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// init chromecast receiver | |
cast.receiver.logger.setLevelValue(0); | |
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance(); | |
console.log('Starting Receiver Manager'); | |
// handler for the 'ready' event | |
castReceiverManager.onReady = function(event) { | |
console.log('Received Ready event: ' + JSON.stringify(event.data)); | |
window.castReceiverManager.setApplicationState("Application status is ready..."); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTMLActuator.prototype.message = function (won) { | |
var type = won ? "game-won" : "game-over"; | |
var message = won ? "You win!" : "Game over!"; | |
this.messageContainer.classList.add(type); | |
this.messageContainer.getElementsByTagName("p")[0].textContent = message; | |
window.messageBus.send(window.senderId, won ? "win" : "lose"); | |
}; | |
HTMLActuator.prototype.clearMessage = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"path": "your_project_path", | |
"file_exclude_patterns": | |
[ | |
"*.dll", | |
"*.meta" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef DEBUG | |
# define debugLog(format, ...) NSLog(@"<Debug>: " format @" [" __FILE__ @":%i]", ##__VA_ARGS__, __LINE__) | |
#else | |
# define debugLog(format, ...) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "main.h" | |
#include "AppDelegate.h" | |
#include "HelloWorldScene.h" | |
#include "cocos2d.h" | |
#include "wx/wx.h" | |
USING_NS_CC; | |
class MyApp : public wxApp | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clock_t t1, t2; | |
t1 = clock(); | |
DoSomething(); | |
t2 = clock(); | |
float diff = ((float)(t2 - t1) / 1000000.0F) * 1000; | |
printf("battle total time : %f \n ", diff); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*class TableDelegate | |
{ | |
public: | |
int GetItemCount(){return 0;} | |
bool OnItemShow( Node *Item, int Index){}; | |
};*/ | |
template<class TableDelegateT> | |
class TableViewUtilEx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN_DLL_API const void* GetDataPtr(const int data_id, int &length) | |
{ | |
length = sizeof(Data); | |
const Data* Dta = ... // 資料來源 | |
if (NULL == Dta) | |
{ | |
return NULL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN_DLL_API bool GetDataRef(const int data_id, | |
Data* ref) | |
{ | |
const go3::BuildDataPN* report = go3::BuildDataTable3::Instance().GetTableData(data_id); | |
if (NULL == report) | |
{ | |
return NULL; | |
} |
OlderNewer