/// <summary> /// Gets a value indicating whether the specified animation name is valid for this sprite. /// </summary> /// <param name="name">The animation name to evaluate.</param> /// <returns><see langword="true"/> if the specified animation name is valid; otherwise, <see langword="false"/>.</returns> public Boolean IsValidAnimationName(SpriteAnimationName name) { if (name.IsName) { return(IsValidAnimationName((String)name)); } else { return(IsValidAnimationIndex((Int32)name)); } }
/// <summary> /// Retrieves the animation with the specified name. /// </summary> /// <param name="name">The name of the animation to retrieve.</param> /// <returns>The <see cref="SpriteAnimation"/> with the specified name, or <see langword="null"/> if no such animation exists.</returns> public SpriteAnimation this[SpriteAnimationName name] { get { if (name.IsIndex) { return(animations[(Int32)name]); } else { SpriteAnimation animation; animationCacheByName.TryGetValue((String)name, out animation); return(animation); } } }