Can someone explain me logic of destination?

Why we put != (nit equal) when we want to link Portal A in scene 1 with Portal A in Scene 2, and Portal B in scene 1 with Portal B in scene 2? I don’t understand the logic. I can write this same line in the code and it works but I don’t understand the logic behind. I would like clarification. From my perspective we want equal destination enum here to link two similar portals.

if(portal.destination != this.destination) continue;

This is within a for loop iterating over all of the portals it can find

if(portal.destination!=this.destination) continue;

simply tells the computer “ok, I’m done with this record, it didn’t have what I’m looking for”, and then the code inside the for/foreach loop moves on to the next Portal in the collection.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms