NKRecord::NKRecordPtr REGFHeader::getRootNKRecord() const { int32_t firstCellOffset = (int32_t)(getDWord(FIRST_KEY_OFFSET_OFFSET)); std::auto_ptr< HBIN > firstHBIN(getFirstHBIN()); if (firstHBIN.get() != NULL) { std::auto_ptr< Cell > cellPtr(firstHBIN->getCellAtOffset(firstCellOffset)); if (cellPtr.get() == NULL) { throw RegistryParseException("Failed to get first cell."); } return cellPtr->getNKRecord(); } else { throw RegistryParseException("Failed to get first HBIN."); } }
cellPtr colonyCell::doGetReplicated() { hasReplicated = true; cellSize = logf(1 + cellSize); return cellPtr(new colonyCell(getPosition() + ofPoint(ofRandom(-1,1),ofRandom(-1,1)) * cellSize, _params)); }