Beispiel #1
0
        protected virtual bool IsVisibleByCategory(TimelineEvent play)
        {
            if (!VisibleEventTypes.Contains(play.EventType))
            {
                return(false);
            }
            if (!eventsFilter.ContainsKey(play.EventType))
            {
                return(true);
            }

            List <Tag> tags = eventsFilter [play.EventType];

            if (tags.Count == 0 || tags.Intersect(play.Tags).Any() ||
                (!play.Tags.Any() && tags.Contains(Tag.EmptyTag)))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        void UpdateVisiblePlays()
        {
            bool cat_match = true, tag_match = true, player_match = true;
            bool period_match = true, timer_match = true;

            VisiblePlays = new List <TimelineEvent> ();

            foreach (TimelineEvent play in project.Timeline)
            {
                cat_match = false;
                if (VisibleEventTypes.Contains(play.EventType))
                {
                    cat_match = true;
                    if (eventsFilter.ContainsKey(play.EventType))
                    {
                        List <Tag> tags = eventsFilter [play.EventType];
                        if (tags.Count == 0 || tags.Intersect(play.Tags).Count() > 0)
                        {
                            cat_match = true;
                        }
                        else
                        {
                            cat_match = false;
                        }
                    }
                }

                if (tagsFilter.Count > 0)
                {
                    if (play.Tags.Count > 0 && play.Tags [0].Value == "Layup")
                    {
                        Console.WriteLine(tagsFilter.Intersect(play.Tags).Count());
                    }
                    if (tagsFilter.Intersect(play.Tags).Count() == 0)
                    {
                        tag_match = false;
                    }
                    else
                    {
                        tag_match = true;
                    }
                }

                if (play.Players.Count == 0 && VisiblePlayers.Count ==
                    project.LocalTeamTemplate.PlayingPlayersList.Count +
                    project.VisitorTeamTemplate.PlayingPlayersList.Count)
                {
                    player_match = true;
                }
                else
                {
                    player_match = VisiblePlayers.Intersect(play.Players).Count() != 0;
                }

                if (timersFilter.Count != 0)
                {
                    timer_match = false;
                }
                foreach (Timer t in timersFilter)
                {
                    foreach (TimeNode tn in t.Nodes)
                    {
                        if (tn.Join(play) != null)
                        {
                            timer_match = true;
                        }
                    }
                }

                if (periodsFilter.Count != 0)
                {
                    period_match = false;
                }
                foreach (Period p in periodsFilter)
                {
                    if (p.PeriodNode.Join(play) != null)
                    {
                        period_match = true;
                    }
                }

                if (player_match && cat_match && tag_match && period_match && timer_match)
                {
                    VisiblePlays.Add(play);
                }
            }
        }