標籤:style blog class code java color
FileUtils
//檔案管理工具FileUtils::getInstance()std::string getStringFromFile(const std::string& filename);//讀取檔案中的字串Data getDataFromFile(const std::string& filename);//擷取檔案資料void setSearchPaths(const std::vector<std::string>& searchPaths);//設定搜尋路徑void addSearchPath(const std::string & path);//增加搜尋路徑bool isFileExist(const std::string& filePath);//判斷檔案是否存在
NotificationCenter
//發送事件CCNotificationCenter::sharedNotificationCenter()->postNotification(CLICK_TEST_MSG, (CCObject*)data);//監聽事件void GameManager::initListener(){ CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(GameManager::onClickTest), CLICK_TEST_MSG, NULL);}//處理事件void GameManager::onClickTest(CCObject* obj){ CCMessageBox("onClickTest", "Title"); //移除監聽事件 CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, CLICK_TEST_MSG);}
typedef void (CCObject::*SEL_SCHEDULE)(float);// 用來調update typedef void (CCObject::*SEL_CallFunc)();// 用來自訂無參回調 typedef void (CCObject::*SEL_CallFuncN)(CCNode*);// 帶執行者回調 typedef void (CCObject::*SEL_CallFuncND)(CCNode*, void*); // 帶一個自定參數的回調 typedef void (CCObject::*SEL_CallFuncO)(CCObject*); typedef void (CCObject::*SEL_MenuHandler)(CCObject*); typedef void (CCObject::*SEL_EventHandler)(CCEvent*); typedef int (CCObject::*SEL_Compare)(CCObject*);