A sequence message can carry a named enum value while preserving which object receives it.
Inside a Controller method, selected refers to Player. PlayerRole defines Keeper, Forward, and Defense. SetRole(PlayerRole role) stores the supplied value in the Role field and returns void.
If the underlying C# feature is unfamiliar, use the lesson below while reading this example.
selected.SetRole(PlayerRole.Keeper);The controller calls SetRole on selected
The argument is the enum value PlayerRole.Keeper
The player stores that value in Role
The void operation completes
No role object is createdUse these words to follow one execution before drawing it. Keep the same order and the same alternatives as the source; simplify the wording without adding work that the code does not perform.
controller : Controller and selected : Player.SetRole(PlayerRole.Keeper). Activate the Player while it handles the request.Role now contains PlayerRole.Keeper. This states the relevant effect without adding an object snapshot to the lifeline heading.completed (void) control return. Do not add a PlayerRole participant or a returned role value.Compare this reference with the diagram you built in Violet. Layout may differ; the source meaning, labels, and relevant connections should agree.
After completion, an object snapshot would show Role = PlayerRole.Keeper for selected. This sequence instead explains the request that led to the state.