Inheritance: BindableBase
Beispiel #1
0
        public void TestSerialization()
        {
            PenaltyCard pc = new PenaltyCard ();
            pc.Color = Color.Red;
            pc.Name = "test";
            pc.Shape = CardShape.Circle;

            Utils.CheckSerialization (pc);

            PenaltyCard pc2 = Utils.SerializeDeserialize (pc);
            Assert.AreEqual (pc.Name, pc2.Name);
            Assert.AreEqual (pc.Color, pc2.Color);
            Assert.AreEqual (pc.Shape, pc2.Shape);
        }
Beispiel #2
0
        public TimelineEvent AddEvent(EventType type, Time start, Time stop, Time eventTime, Image miniature,
                                      Score score, PenaltyCard card, bool addToTimeline = true)
        {
            TimelineEvent evt;
            string        count;
            string        name;

            count = String.Format("{0:000}", EventsByType(type).Count + 1);
            if (type is PenaltyCardEventType)
            {
                name = String.Format("{0} {1}", card.Name, count);
                evt  = new PenaltyCardEvent {
                    PenaltyCard = card
                };
            }
            else if (type is ScoreEventType)
            {
                name = String.Format("{0} {1}", score.Name, count);
                evt  = new ScoreEvent {
                    Score = score
                };
            }
            else
            {
                name = String.Format("{0} {1}", type.Name, count);
                evt  = new TimelineEvent();
            }

            evt.Name          = name;
            evt.Start         = start;
            evt.Stop          = stop;
            evt.EventTime     = eventTime;
            evt.EventType     = type;
            evt.Notes         = "";
            evt.Miniature     = miniature;
            evt.CamerasConfig = new List <CameraConfig> {
                new CameraConfig(0)
            };

            if (addToTimeline)
            {
                Timeline.Add(evt);
                if (evt is ScoreEvent)
                {
                    UpdateScore();
                }
            }
            return(evt);
        }
Beispiel #3
0
        public void EmitNewEvent(EventType eventType, List<Player> players = null, TeamType team = TeamType.NONE,
		                          List<Tag> tags = null, Time start = null, Time stop = null,
		                          Time eventTime = null, Score score = null, PenaltyCard card = null)
        {
            if (NewEventEvent != null)
                NewEventEvent (eventType, players, team, tags, start, stop, eventTime, score, card, null);
        }
Beispiel #4
0
        void HandleNewTagEvent(EventType evntType, List<Player> players, TeamType team, List<Tag> tags,
		                        Time start, Time stop, Time eventTime, Score score, PenaltyCard card, DashboardButton btn)
        {
            /* Forward event until we have players integrted in the dashboard layout */
            if (NewTagEvent != null) {
                NewTagEvent (evntType, players, team, tags, start, stop, eventTime, score, card, btn);
            }
            //Config.EventsBroker.EmitNewTag (button, players, tags, start, stop);
        }
Beispiel #5
0
 public PenaltyCardEventType()
 {
     PenaltyCard = new PenaltyCard();
 }
Beispiel #6
0
        public void OnNewTag(EventType evType, List<Player> players, TeamType team, List<Tag> tags,
		                      Time start, Time stop, Time eventTime, Score score, PenaltyCard card, DashboardButton btn)
        {
            if (player == null || openedProject == null)
                return;

            if (projectType == ProjectType.CaptureProject ||
                projectType == ProjectType.URICaptureProject) {
                if (!capturer.Capturing) {
                    guiToolkit.WarningMessage (Catalog.GetString ("Video capture is stopped"));
                    return;
                }
            }
            Log.Debug (String.Format ("New play created start:{0} stop:{1} category:{2}",
                start.ToMSecondsString (), stop.ToMSecondsString (),
                evType.Name));
            /* Add the new created play to the project and update the GUI*/
            var play = openedProject.AddEvent (evType, start, stop, eventTime, null, score, card);
            play.Team = team;
            if (players != null) {
                play.Players = players;
            }
            if (tags != null) {
                play.Tags = tags;
            }
            AddNewPlay (play);
        }