/// <summary> /// Registers a title. /// </summary> /// <param name="title">The title to register.</param> /// <returns>true if successful.</returns> public static bool RegisterTitle(IPlayerTitle title) { if (title == null) { return(false); } Type t = title.GetType(); if (m_titles.Any(ttl => ttl.GetType() == t)) { return(false); } m_titles.Add(title); return(true); }
/// <summary> /// Registers a title. /// </summary> /// <param name="title">The title to register.</param> /// <returns>true if successful.</returns> public static bool RegisterTitle(IPlayerTitle title) { if (title == null) { return(false); } Type t = title.GetType(); foreach (IPlayerTitle ti in m_titles) { if (ti.GetType() == t) { return(false); } } m_titles.Add(title); return(true); }
/// <summary> /// Registers a title. /// </summary> /// <param name="title">The title to register.</param> /// <returns>true if successful.</returns> public static bool RegisterTitle(IPlayerTitle title) { if (title == null) return false; Type t = title.GetType(); if (m_titles.Any(ttl => ttl.GetType() == t)) return false; m_titles.Add(title); return true; }
/// <summary> /// Registers a title. /// </summary> /// <param name="title">The title to register.</param> /// <returns>true if successful.</returns> public static bool RegisterTitle(IPlayerTitle title) { if (title == null) return false; Type t = title.GetType(); foreach (IPlayerTitle ti in m_titles) { if (ti.GetType() == t) return false; } m_titles.Add(title); return true; }