added events
This commit is contained in:
@ -49,6 +49,18 @@
|
||||
p.max-lifelines = calc.max(p.max-lifelines, p.lifeline-lvl)
|
||||
participants.at(i2) = p
|
||||
}
|
||||
} else if elmt.type == "evt" {
|
||||
let par-name = elmt.participant
|
||||
let i = pars-i.at(par-name)
|
||||
let par = participants.at(i)
|
||||
if elmt.event == "disable" or elmt.event == "destroy" {
|
||||
par.lifeline-lvl -= 1
|
||||
|
||||
} else if elmt.event == "enable" {
|
||||
par.lifeline-lvl += 1
|
||||
par.max-lifelines = calc.max(par.max-lifelines, par.lifeline-lvl)
|
||||
}
|
||||
participants.at(i) = par
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +185,29 @@
|
||||
// Gap
|
||||
} else if elmt.type == "gap" {
|
||||
y -= elmt.size
|
||||
|
||||
// Event
|
||||
} else if elmt.type == "evt" {
|
||||
let par-name = elmt.participant
|
||||
let i = pars-i.at(par-name)
|
||||
let par = participants.at(i)
|
||||
let line = lifelines.at(i)
|
||||
if elmt.event == "disable" {
|
||||
line.level -= 1
|
||||
line.lines.push(("disable", y))
|
||||
|
||||
} else if elmt.event == "destroy" {
|
||||
line.lines.push(("destroy", y))
|
||||
|
||||
} else if elmt.event == "enable" {
|
||||
line.level += 1
|
||||
line.lines.push(("enable", y, elmt.lifeline-style))
|
||||
|
||||
} else if elmt.event == "create" {
|
||||
shapes += participant.render(x-pos, par, y: y)
|
||||
line.lines.push(("create", y))
|
||||
}
|
||||
lifelines.at(i) = line
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user