Esempio n. 1
0
        /// <summary>
        ///     Determines whether the specified hediff definition is an associated mutation .
        /// </summary>
        /// <param name="mutationDef">The hediff definition.</param>
        /// <returns>
        ///     <c>true</c> if the specified hediff definition is an associated mutation; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="ArgumentNullException">hediffDef</exception>
        public bool IsAnAssociatedMutation([NotNull] MutationDef mutationDef)
        {
            if (mutationDef == null)
            {
                throw new ArgumentNullException(nameof(mutationDef));
            }

            return(AllAssociatedMutations.Contains(mutationDef));
        }
Esempio n. 2
0
        /// <summary>
        ///     Determines whether the given hediff is an associated mutation.
        /// </summary>
        /// <param name="hediff">The hediff.</param>
        /// <returns>
        ///     <c>true</c> if the specified hediff is an associated mutation ; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="ArgumentNullException">hediff</exception>
        public bool IsAnAssociatedMutation([NotNull] Hediff hediff)
        {
            if (hediff?.def == null)
            {
                throw new ArgumentNullException(nameof(hediff));
            }
            if (hediff is Hediff_AddedMutation mutation)
            {
                return(AllAssociatedMutations.Contains(mutation.def as MutationDef));
            }

            return(false);
        }
Esempio n. 3
0
        public bool IsAnAssociatedMutation([NotNull] HediffDef hediffDef)
        {
            if (hediffDef == null)
            {
                throw new ArgumentNullException(nameof(hediffDef));
            }
            if (hediffDef is MutationDef mDef)
            {
                return(AllAssociatedMutations.Contains(mDef));
            }

            return(false);
        }