/// <summary> Searches for player names starting with namePart, returning just one or none of the matches. </summary>
 /// <param name="partialName"> Partial or full player name. </param>
 /// <param name="result"> PlayerInfo to output (will be set to null if no single match was found). </param>
 /// <returns> true if one or zero matches were found, false if multiple matches were found. </returns>
 public bool FindOneByPartialName(string partialName, out PlayerInfo result)
 {
     if (partialName == null)
     {
         throw new ArgumentNullException("partialName");
     }
     lock (trie.SyncRoot) {
         return(trie.GetOneMatch(partialName, out result));
     }
 }
示例#2
0
 /// <summary>Searches for player names starting with namePart, returning just one or none of the matches.</summary>
 /// <param name="name">Partial or full player name</param>
 /// <param name="info">PlayerInfo to output (will be set to null if no single match was found)</param>
 /// <returns>true if one or zero matches were found, false if multiple matches were found</returns>
 public static bool FindPlayerInfo(string name, out PlayerInfo info)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     lock ( AddLocker ) {
         return(Trie.GetOneMatch(name, out info));
     }
 }
示例#3
0
 /// <summary>Searches for player names starting with namePart, returning just one or none of the matches.</summary>
 /// <param name="namePart">Partial or full player name</param>
 /// <param name="info">PlayerInfo to output (will be set to null if no single match was found)</param>
 /// <returns>true if one or zero matches were found, false if multiple matches were found</returns>
 internal static bool FindPlayerInfo([NotNull] string namePart, out PlayerInfo info)
 {
     if (namePart == null)
     {
         throw new ArgumentNullException("namePart");
     }
     CheckIfLoaded();
     lock ( AddLocker ) {
         return(Trie.GetOneMatch(namePart, out info));
     }
 }