Ejemplo n.º 1
0
        /// <summary>
        /// Checks if the thing has the given condition.
        /// </summary>
        /// <param name="thing">The thing to check the conditions on.</param>
        /// <param name="conditionType">The type of condition.</param>
        /// <returns>True if the thing has such condition, false otherwise.</returns>
        public static bool HasCondition(this IThing thing, ConditionType conditionType)
        {
            thing.ThrowIfNull(nameof(thing));
            conditionType.ThrowIfNull(nameof(conditionType));

            return(thing.TrackedEvents.ContainsKey(conditionType.ToString()));
        }