我正试图在PlantUML中绘制一个21点游戏的图表,以帮助记录一些代码,并且我有一些我想要删除的空活动状态。
@startuml
skinparam defaultTextAlignment center
start
:Create Game \n(num_players, num_decks);
:Deal Cards\n(2 per player/dealer);
if (Dealer Shows Ace?) then (Yes)
:Offer Insurance;
if (Player takes insurance) then (Yes)
else (No)
endif
else (No)
endif
:Evaluate Hand;
:Next State;
@enduml

发布于 2022-08-19 13:52:23
您突出显示的菱形节点不是状态,而是合并节点,它们对应于决策(if)节点。UML的语法基本上要求它们在那里。
也许通过添加一个单独的动作"Set Insurance“(记住玩家接受了它),这两个合并节点将更有意义?
@startuml
skinparam defaultTextAlignment center
start
:Create Game \n(num_players, num_decks);
:Deal Cards\n(2 per player/dealer);
if (Dealer Shows Ace?) then (Yes)
:Offer Insurance;
if (Player takes insurance) then (Yes)
:Set Insurance;
else (No)
endif
else (No)
endif
:Evaluate Hand;
:Next State;
@enduml

https://stackoverflow.com/questions/71105262
复制相似问题