Exemple #1
0
        /// <summary>
        ///     Finds the first tag which has a given name.
        /// </summary>
        /// <param name="name">The case-sensitive tag name to search for.</param>
        /// <param name="names">The <see cref="FileNameSource" /> containing tag names.</param>
        /// <returns>The first tag which has the given name, or null if nothing was found.</returns>
        public ITag FindTagByName(string name, FileNameSource names)
        {
            int index = names.FindName(name);

            if (index != -1)
            {
                return(this[index]);
            }
            return(null);
        }
Exemple #2
0
 /// <summary>
 ///     Finds the first tag in a group which has a given name.
 /// </summary>
 /// <param name="name">The case-sensitive tag name to search for.</param>
 /// <param name="groupMagic">The magic number (ID) of the tag group to search in.</param>
 /// <param name="names">The <see cref="FileNameSource" /> containing tag names.</param>
 /// <returns>The first tag in the group which has the given name, or null if nothing was found.</returns>
 public ITag FindTagByName(string name, int groupMagic, FileNameSource names)
 {
     foreach (ITag tag in FindTagsByGroup(groupMagic))
     {
         if (names.GetTagName(tag) == name)
         {
             return(tag);
         }
     }
     return(null);
 }
Exemple #3
0
 /// <summary>
 ///     Finds the first tag in a group which has a given name.
 /// </summary>
 /// <param name="name">The case-sensitive tag name to search for.</param>
 /// <param name="tagGroup">The tag group to search in.</param>
 /// <param name="names">The <see cref="FileNameSource" /> containing tag names.</param>
 /// <returns>The first tag in the group which has the given name, or null if nothing was found.</returns>
 public ITag FindTagByName(string name, ITagGroup tagGroup, FileNameSource names)
 {
     return(FindTagByName(name, tagGroup.Magic, names));
 }
Exemple #4
0
 /// <summary>
 ///     Finds the first tag in a group which has a given name.
 /// </summary>
 /// <param name="name">The case-sensitive tag name to search for.</param>
 /// <param name="groupName">
 ///     The case-sensitive four-letter string representation of the name of the group to search in
 ///     (e.g. "bipd").
 /// </param>
 /// <param name="names">The <see cref="FileNameSource" /> containing tag names.</param>
 /// <returns>The first tag in the group which has the given name, or null if nothing was found.</returns>
 public ITag FindTagByName(string name, string groupName, FileNameSource names)
 {
     return(FindTagByName(name, CharConstant.FromString(groupName), names));
 }
Exemple #5
0
 /// <summary>
 ///     Finds the first tag in a class which has a given name.
 /// </summary>
 /// <param name="name">The case-sensitive tag name to search for.</param>
 /// <param name="tagClass">The tag class to search in.</param>
 /// <param name="names">The <see cref="FileNameSource" /> containing tag names.</param>
 /// <returns>The first tag in the class which has the given name, or null if nothing was found.</returns>
 public ITag FindTagByName(string name, ITagClass tagClass, FileNameSource names)
 {
     return(FindTagByName(name, tagClass.Magic, names));
 }