Pirate* Pirate::createPirate(int hp) { Pirate *pRet = new Pirate(); if (pRet && pRet->init()) { pRet->setMaxHp(hp); pRet->setCurrHp(hp); pRet->autorelease(); return pRet; } else { delete pRet; pRet = NULL; return NULL; } }
Pirate* Pirate::createPirate(Vector<Node*> points, int hp) { Pirate *pRet = new Pirate(); if (pRet && pRet->init()) { pRet->setPointsVector(points); pRet->setMaxHp(hp); pRet->setCurrHp(hp); pRet->runFllowPoint(); pRet->autorelease(); return pRet; } else { delete pRet; pRet = NULL; return NULL; } }