Hi,
You need to implement some kind of logical representation of your game progress.
you need to be able to know if a piece of the puzzle is on the right slot or not. This is your first step.
Then, you have several options to check if a puzzle is complete.
either, you maintain an simple integer as a global int ( you know what I mean by that yes?). And each piece when moved, check for its state and increment by one or decrement by one this integer, so if you have 10 piece. If the int is equal to 10, then it means all pieces are in place, you win. This technic would imply that when initializing the game, you don't forget to have each piece checking for its state, cause some might be on the right spot already.
One other way would be:
1: set a boolean value "is puzzle complete" to true
2: to send a global event "CHECK" for example, and each piece would receive this event. If one piece is not in place, then it throws a global event "FAIL", the fail event would set "is puzzle complete" to false.
3: you then simply check for "is puzzle complete" after you sent that "CHECK" event and you know if the user won or not.
Hopefully, you understand what I mean, if some concepts are missing, let me know, I'll explain more in details.
Bye,
Jean