@startuml StudentUsesTransistor
header Student Uses Transistor (teleports)
hide footbox

participant student as "student : Student"
participant actions as "studentAction : StudentActions"
participant room as "room : Room"
participant room2 as "room2 : Room"
participant t1 as "transistorA: Transistor"
participant t2 as "transistorB: Transistor"

' lets assume they are already paired

' this already contains the init
ref over student, t2: Student Pairs Transistor

-> student ++ : use(transistorA)
student -> actions ++ : use(transistorA)

actions -> t1++: use(student)
    t1 -> t2++: getLocation()
    return room2

    t1 -> student++: teleport(room2, false)
        student ->room2++: enter(student, false)
        room2 -> room2: isFull()
        return success

        opt success == true
            student -> room ++: leave(student)
            return
    return
            t1 -> t2: setPair(null)
            t1 -> t1: setPair(null)
        end
return
return
return

@enduml