public override void Add(SkillFlowComponent component) { if (component is Text text) { switch (text.TextType) { case "say": this.Say = text; break; case "reprompt": this.Reprompt = text; break; case "recap": this.Recap = text; break; } } else if (component is Visual visual) { this.Visual = visual; } else if (component is SceneInstructions instructions) { this.Instructions = instructions; } else { throw this.InvalidComponent(component); } }
public override void Add(SkillFlowComponent component) { switch (component) { case VisualProperty property: switch (property.Key) { case "template": Template = property; break; case "background": Background = property; break; case "title": Title = property; break; case "subtitle": Subtitle = property; break; default: throw this.InvalidComponent(component); } break; default: throw this.InvalidComponent(component); } }
public override void Add(SkillFlowComponent component) { if (component is SceneInstruction instruction) { Instructions.Add(instruction); } else { throw new InvalidSkillFlowException($"Unable to add {component.Type} to {Type}"); } }
public override void Add(SkillFlowComponent component) { switch (component) { case Scene scene: Scenes.Add(scene.Name, scene); break; default: throw this.InvalidComponent(component); } }
public override void Add(SkillFlowComponent component) { if (component is Variation _) { Content.Add(string.Empty); return; } else if (component is TextLine textline) { if (Content.Count == 0) { Content.Add(textline.Text); } else { var oldContent = Content[Content.Count - 1]; Content.RemoveAt(Content.Count - 1); Content.Add(oldContent + textline.Text); } return; } throw this.InvalidComponent(component); }
public virtual void Add(SkillFlowComponent component) { throw this.InvalidComponent(component); }