public SilkTagBase SetTag(string tagName, List <string> args) { switch (tagName) { case "name": NameTag newName = new NameTag(tagName, args); return(newName); case "prompt": PromptTag newPrompt = new PromptTag(tagName); return(newPrompt); case "speaker": SpeakerTag newSpeaker = new SpeakerTag(tagName, args); return(newSpeaker); case "pronoun": PronounTag newPronoun = new PronounTag(tagName, args); return(newPronoun); case "nexttree": NextTreeTag newTreeTag = new NextTreeTag(tagName, args); return(newTreeTag); //case "state": // StateTag newState = new StateTag (tagName, args); // return newState; //case "unload": //break; //UnloadTag newUnload = new UnloadTag (tagName); //return newUnload; case "sfx": SoundEffectTag newSFX = new SoundEffectTag(tagName, args); return(newSFX); case "audioclip": AudioClipTag newAudioClip = new AudioClipTag(tagName, args); return(newAudioClip); case "noprompt": NoPrompTag newNoPrompt = new NoPrompTag(tagName, args); return(newNoPrompt); case "videoclip": VideoClipTag newVideoClip = new VideoClipTag(tagName, args); return(newVideoClip); case "connect": ConnectTag newConnectTag = new ConnectTag(tagName, args); return(newConnectTag); case "action": ActionTag newActionTag = new ActionTag(tagName, args); return(newActionTag); default: DummyTag newDummy = new DummyTag(tagName, args); return(newDummy); } }
public void PlaySoundEffect(SoundEffectTag soundEffectTag) { foreach (SoundEffectTag tag in System.Enum.GetValues(typeof(SoundEffectTag))) { if (soundEffectTag == tag) { soundEffectsMap[soundEffectTag].Play(); } } }
public ReplacableByTagsAttribute(SoundEffectTag tag, params SoundEffectTag[] additionalTags) { var tags = new List <SoundEffectTag> { tag }; if (additionalTags?.Length > 0) { tags.AddRange(additionalTags); } Tags = new ReadOnlyCollection <SoundEffectTag>(tags); }
/// <summary> /// Checks if current sound is tagged with provided tag /// </summary> /// <returns></returns> public static bool HasTag(this SoundEffect sound, SoundEffectTag tag) { return(sound.GetAttribute <TagsAttribute>()?.Tags?.Contains(tag) ?? false); }
public void StopSoundEffect(SoundEffectTag soundEffectTag) { soundEffectsMap[soundEffectTag].Stop(); }
public void PlaySoundEffect(SoundEffectTag soundEffectTag) { soundEffectsMap[soundEffectTag].Play(); }