Diagramme de séquences - ThePension/poutinestyle GitHub Wiki

sequenceDiagram
 participant Player
 participant System
loop until end of level 5 reached
 loop until dead
   Player->>+System: move
   activate Player
   alt is empty
    System->>Player: moving
   else is wall
    System->>Player: beeing blocked
   else is entity
    System->>-Player: beeing blocked
  end
 deactivate Player

  
   Player->>+System: shoot
  activate Player
  deactivate Player
   alt is load
    System->>Player: fire
   else is empty
    System->>-Player: nothing
  end

   Player->>+System: reload
 activate Player
deactivate Player
   alt has munition in inventory
    System->>Player: reload
   else has no more munition
    System->>-Player: nothing
  end

   Player->>+System: change weapon
  activate Player
  deactivate Player
  alt wear gun
    System->>Player: take knife
   else wear knife
    System->>-Player: take gun
   end
  

   Player->>+System: entity
   activate Player
   deactivate Player
   alt is door ? 
    alt is open 
     System->>Player: door is open
    else is closed
     System->>Player: door is close
     System->>Player: message 
     Note over System,Player: You did not unlock the door
    end
   else is object ?
    alt is life
     System->>Player: take life 
     Note right of System: Can't store health, direct intake of it.
    else is amunition
     System->>Player: Take amunition
    else is locker
     System->>Player: Locker reached
     Note over System,Player: You unlock the linked door.
    else is gun
     System->>Player: message 
     Note over System,Player: Do you want to take this gun ?
     alt yes
      System->>Player: gun taken
     else no
      System->>Player: nothing
     end
    end
   else is PNJ ?
    alt is 1st meet
     System->>Player: dialogue
     opt is final ?
      System->>Player: go to next level
   end
    else is not 1st meet
     System-->Player: dialogue ?
     alt yes
      System->>Player: dialog
     else no
      System->>Player: skip dialogue
     end

  end
 end
  System->>Player: enemy shoot
  alt is life
   System->>Player: decrease health
  else is no life
   System->>Player: You are dead
  end
 end
System->>Player: Game over
end 
System->>-Player: You win