Ejemplo n.º 1
0
        /// <summary>
        /// Returns the most recent child we added which is castable to the inputted type and satisfies the inputted condition.
        /// Shouldn't really be called unless we have children
        /// </summary>
        /// <returns>The most recent child we added</returns>
        public K LastChild <K>(Predicate <K> condition) where K : T
        {
            K lastChildOfType = ActiveObjects.FindLast(x => x is K && condition(x as K)) as K;

            DebugUtils.AssertNotNull(lastChildOfType);

            return(lastChildOfType);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the most recent child we added which is castable to the inputted type.
        /// Shouldn't really be called unless we have children
        /// </summary>
        /// <returns>The most recent child we added</returns>
        public K LastChild <K>() where K : T
        {
            K lastChildOfType = ActiveObjects.FindLast(x => x is K) as K;

            DebugUtils.AssertNotNull(lastChildOfType);

            return(lastChildOfType);
        }