@startuml skinparam sequenceMessageAlign center skinparam ParticipantBackgroundColor #FFFF9F autoactivate on hide footbox title Go into Stephen's Office participant Interpreter as I participant CommandFactory as CF participant ":CommandFactory" as CFO participant ":Command" as C participant GameState as GS participant ":GameState" as GSO participant "backHallway:Room" as backHallway participant "exits:ArrayList" as bHexits participant "e1:Exit" as e1 participant "e2:Exit" as e2 participant "office:Room" as office participant "exits2:ArrayList" as oexits participant "e3:Exit" as e3 I -> CF : instance() create CFO CF -> CFO : new CommandFactory() return return theInstance I -> CFO : parse("s") create C CFO -> C : new Command("s") return return I -> C : execute() C -> GS : instance() create GSO GS -> GSO : new GameState() return return theInstance C -> GSO : getAdventurersCurrentRoom() return backHallway C -> backHallway : leaveBy("s") backHallway -> bHexits : size() return 2 backHallway -> bHexits : get(0) return e1 backHallway -> e1 : getDir() return "w" backHallway -> bHexits : get(1) return e2 backHallway -> e2 : getDir() return "s" backHallway -> e2 : getDest() return office return office C -> GSO : setAdventurersCurrentRoom(office) return C -> office : describe() autoactivate off office -> office : getName() autoactivate on office -> GS : instance() return theInstance office -> GSO : hasBeenVisited() return false office -> GSO : visit(this) return autoactivate off office -> office : getDesc() autoactivate on office -> oexits : size() return 1 office -> oexits : get(0) return e3 office -> e3 : describe() return "You can go n to Back Hallway." return "Stephen's Office....This is a geeky room...You can go n to Back Hallway." return "Stephen's Office....This is a geeky room...You can go n to Back Hallway." @enduml