/** * @brief VirtualDirectory::operator = * @param rhs * @return */ VirtualDirectory &VirtualDirectory::operator =(VirtualDirectory rhs) { VirtualFileSystemAbstractItem::operator =(rhs); moveFrom(std::move(rhs)); return *this; }
queue& operator =(queue&& other) { if (this != other) { moveFrom(other); } return *this; }
void moveFrom(int x, int y, int step){ int i,tempx,tempy; printf("%d %d--->\n", x, y); int tempboard[8][8]; memset(tempboard, 0, sizeof(tempboard)); for(i=0; i<8; i++){ tempx = x+dx[i]; tempy = y+dy[i]; if(!inRange(tempx, tempy)) continue; if(board[tempx][tempy] == -1){ printf("%d %d\n", tempx, tempy); board[tempx][tempy] = step; tempboard[tempx][tempy] = -1; } } printBoard(); for(i=0; i<8; i++){ tempx = x+dx[i]; tempy = y+dy[i]; if(!inRange(tempx, tempy)) continue; if(tempboard[tempx][tempy] == -1){ moveFrom(tempx, tempy, step+1); } } }
/** * @brief Database::operator = * @param rhs * @return */ Database &Database::operator =(Database &&rhs) { if (this != &rhs) moveFrom(rhs); return *this; }
/** * @brief ProjectDatabase::operator = * @param rhs * @return */ ProjectDatabase &ProjectDatabase::operator =(ProjectDatabase &&rhs) { if (this != &rhs) moveFrom(rhs); return *this; }
/** * @brief Class::operator = * @param rhs * @return */ Class &Class::operator =(Class &&rhs) { if (this != &rhs) moveFrom(std::move(rhs)); return *this; }
/** * @brief Type::operator = * @param rhs * @return */ Type &Type::operator =(Type &&rhs) { if (this != &rhs) moveFrom(std::move(rhs)); return *this; }
void Game::getCoordinates(){ moveFrom(); moveTo(); moveFromX = repairCoordinatesX( moveFromX ); moveToX = repairCoordinatesX( moveToX ); moveFromY = repairCoordinatesY( moveFromY ); moveToY = repairCoordinatesY( moveToY); }
/** * @brief VirtualDirectory::operator = * @param rhs * @return */ VirtualDirectory &VirtualDirectory::operator =(VirtualDirectory &&rhs) noexcept { if (this != &rhs) { VirtualFileSystemAbstractItem::operator =(rhs); moveFrom(std::move(rhs)); } return *this; }
/** * @brief ClassMethod::operator = * @param rhs * @return */ ClassMethod &ClassMethod::operator =(ClassMethod &&rhs) { if (this != &rhs) { static_cast<BasicElement*>(this)->operator =(std::forward<ClassMethod>(rhs)); moveFrom(std::forward<ClassMethod>(rhs)); } return *this; }
int main(){ int x1, y1, x2, y2; s(x1), s(y1), s(x2), s(y2); x1--, y1--, x2--, y2--; memset(board, -1, sizeof(board)); board[x1][y1]=0; moveFrom(x1,y1,1); //printf("No of steps : %d\n", board[x2][y2]); printBoard(); }
//predator.cc void Predator::process(void) { Coordinate toCoord; if (--timeToFeed <= 0) { assignCellAt(*offset, new Cell(*offset)); Ocean1->setNumPredators(Ocean1->getNumPredators()-1); delete this; } else { toCoord = getPreyNeighborCoord(); if (toCoord != *offset) { Ocean1->setNumPrey(Ocean1->getNumPrey()-1); timeToFeed = TimeToFeed; moveFrom(*offset, toCoord); } else Prey::process(); } }
/** * @brief VirtualDirectory::VirtualDirectory * @param src */ VirtualDirectory::VirtualDirectory(VirtualDirectory &&src) noexcept : VirtualFileSystemAbstractItem(src) { moveFrom(std::move(src)); }
void operator = (const GrowingAllocator &other) { moveFrom(const_cast<GrowingAllocator &>(other)); }
/** * @brief ProjectDatabase::ProjectDatabase * @param src */ ProjectDatabase::ProjectDatabase(ProjectDatabase &&src) { moveFrom(src); }
// coverity[pass_by_value] ProjectDatabase &ProjectDatabase::operator =(ProjectDatabase rhs) { moveFrom(rhs); return *this; }
/** * @brief Class::Class * @param src */ Class::Class(Class &&src) { moveFrom(std::move(src)); }
/** * @brief Database::operator = * @param rhs * @return */ Database &Database::operator =(Database rhs) { moveFrom(rhs); return *this; }
/** * @brief Database::Database * @param src */ Database::Database(Database &&src) { moveFrom(src); }
/** * @brief ClassMethod::ClassMethod * @param src */ ClassMethod::ClassMethod(ClassMethod &&src) : BasicElement(std::move(src)) { moveFrom(std::move(src)); }
queue(queue&& other) { moveFrom(other); }
/** * @brief Type::Type * @param src */ Type::Type(Type &&src) { moveFrom(std::move(src)); }