Exemplo n.º 1
0
        public override TaskState Process()
        {
            if (RelaConditions != null)
            {
                var entities = IncludeTask.GetEntites(Type, Controller, Source, Target, Playables);

                if (entities.Count != 1)
                {
                    return(TaskState.STOP);
                }

                Playables = Playables
                            .Where(p1 => RelaConditions.ToList().TrueForAll(p2 => p2.Eval(entities[0], p1)))
                            .ToList();
            }

            if (SelfConditions != null)
            {
                Playables = Playables
                            .Where(p1 => SelfConditions.ToList().TrueForAll(p2 => p2.Eval(p1)))
                            .ToList();
            }

            return(TaskState.COMPLETE);
        }
Exemplo n.º 2
0
        public override TaskState Process()
        {
            if (RelaConditions != null)
            {
                System.Collections.Generic.List <Model.Entities.IPlayable> entities = IncludeTask.GetEntites(Type, Controller, Source, Target, Playables);

                if (entities.Count != 1)
                {
                    return(TaskState.STOP);
                }

                Playables = Playables
                            .Where(p1 => RelaConditions.ToList().TrueForAll(p2 => p2.Eval(entities[0], p1)))
                            .ToList();
            }

            if (SelfConditions != null)
            {
                var selfConditionList = SelfConditions.Where(x => x != null).ToList();
                Playables = Playables
                            .Where(p1 => selfConditionList.TrueForAll(p2 => p2.Eval(p1)))
                            .ToList();
            }

            return(TaskState.COMPLETE);
        }
Exemplo n.º 3
0
        public override TaskState Process()
        {
            var entities = IncludeTask.GetEntites(Type, Controller, Source, Target, Playables);

            if (entities.Count == 0)
            {
                return(TaskState.STOP);
            }

            var source = (IPlayable)Source;

            Flag = entities.TrueForAll(p =>
                                       SelfConditions.ToList().TrueForAll(c => c.Eval(p)) &&
                                       RelaConditions.ToList().TrueForAll(c => c.Eval(source, p)));

            return(TaskState.COMPLETE);
        }