choice in the doc interface + tests

This commit is contained in:
Alexey Fedoseev
2024-04-23 12:13:20 +03:00
parent 8b0db7081f
commit 7fab5056e0
5 changed files with 137 additions and 0 deletions

View File

@@ -1278,6 +1278,34 @@ FinalState* Document::new_final(ElementCollection* _parent, const ID& _id, const
return fin;
}
ChoicePseudostate* Document::new_choice(ElementCollection* _parent, const Rect& r, const Color& c)
{
check_parent_element(_parent);
ChoicePseudostate* choice = new ChoicePseudostate(_parent, generate_vertex_id(_parent), r, c);
_parent->add_element(choice);
return choice;
}
ChoicePseudostate* Document::new_choice(ElementCollection* _parent, const Name& _name, const Rect& r, const Color& c)
{
check_parent_element(_parent);
ChoicePseudostate* choice = new ChoicePseudostate(_parent, generate_vertex_id(_parent), _name, r, c);
_parent->add_element(choice);
return choice;
}
ChoicePseudostate* Document::new_choice(ElementCollection* _parent, const ID& _id, const Name& _name, const Rect& r, const Color& c)
{
check_parent_element(_parent);
check_id_uniqueness(_id);
ChoicePseudostate* choice = new ChoicePseudostate(_parent, generate_vertex_id(_parent), _name, r, c);
_parent->add_element(choice);
return choice;
}
void Document::check_cyberiada_error(int res, const String& msg) const
{
switch (res) {