Logo Search packages:      
Sourcecode: palapeli version File versions  Download package

void Palapeli::Pattern::addRelation ( int  piece1Id,
int  piece2Id 
) [protected, inherited]

Adds a neighbor relation between two pieces.

piece1Id the index of the first piece (assigned by order of addPiece operations, starting at zero)
piece2Id the index of the second piece
See also:

Definition at line 134 of file pattern.cpp.

References Palapeli::Pattern::allPiecesGenerated(), Palapeli::Pattern::CreatePuzzle, Palapeli::Pattern::mode(), and Palapeli::Pattern::relationGenerated().

Referenced by doSlice(), Palapeli::JigsawPattern::doSlice(), and Palapeli::HexagonalPattern::doSlice().

      if (mode() != CreatePuzzle)
      //at this point, we assume that all pieces have been created
      if (!p->m_emittedAllPiecesGeneratedSignal)
            emit allPiecesGenerated();
            p->m_emittedAllPiecesGeneratedSignal = true;
      emit relationGenerated(piece1Id, piece2Id);

Generated by  Doxygen 1.6.0   Back to index