Пример #1
0
        /// <summary>
        /// 获取Action中配置的Effects值
        /// </summary>
        /// <param name="action"></param>
        /// <param name="tag"></param>
        /// <typeparam name="TAction"></typeparam>
        /// <returns></returns>
        public static CondtionAssembly GetEffectsValue <TAction>(this IAction <TAction> action, CondtionTag tag)
        {
            foreach (var effect in action.Effects)
            {
                if (effect.ElementTag == tag)
                {
                    return(effect);
                }
            }

            return(default);
Пример #2
0
 public CondtionAssembly(CondtionTag elementTag, bool right)
 {
     this.ElementTag = elementTag;
     this.IsRight    = right;
 }
Пример #3
0
        /// <summary>
        /// 根据条件队列
        /// 提供标签返回相应的值
        /// </summary>
        /// <param name="collection"></param>
        /// <param name="tag"></param>
        /// <typeparam name="T1"></typeparam>
        /// <typeparam name="T2"></typeparam>
        /// <returns></returns>
        public static CondtionAssembly GetDiffecentCondition(this ICollection <CondtionAssembly> collection, CondtionTag tag)
        {
            foreach (var unit in collection)
            {
                if (unit.ElementTag == tag)
                {
                    return(unit);
                }
            }

            return(null);
        }