Exemplo n.º 1
0
        /// <summary>
        /// Indicates if the faction has a parent faction.
        /// </summary>
        /// <typeparam name="TStringType">String type.</typeparam>
        /// <param name="entry">The faction entry.</param>
        /// <returns>True if the faction has a parent team/faction.</returns>
        public static bool HasParentFaction <TStringType>([NotNull] this FactionEntry <TStringType> entry)
        {
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }

            //Default is 0.
            return(entry.ParentFactionId > 0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Indicates if a player can gain reputation with the faction.
        /// </summary>
        /// <typeparam name="TStringType">String type.</typeparam>
        /// <param name="entry">The faction entry.</param>
        /// <returns>True if the player can gain reputation with the faction.</returns>
        public static bool IsReputationGainable <TStringType>([NotNull] this FactionEntry <TStringType> entry)
        {
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }

            //From dev wiki: Each faction that has gainable rep has a unique number. All factions that you can not gain rep with have -1. Max value 127.
            return(entry.ReputationIndex > 0);
        }