Beispiel #1
0
 void HandlePlayersSubstitutionEvent(Team team, Player p1, Player p2,
                                     SubstitutionReason reason, Time time)
 {
     team.List.Swap(p1, p2);
     teamtagger.Substitute(p1, p2, team);
     Edited = true;
 }
Beispiel #2
0
        public SubstitutionEvent SubsitutePlayer(LMTeam team, LMPlayer playerIn, LMPlayer playerOut,
                                                 SubstitutionReason reason, Time subsTime)
        {
            LineupEvent       lineup;
            SubstitutionEvent se;

            lineup = Timeline.OfType <LineupEvent> ().FirstOrDefault();
            if (lineup == null)
            {
                throw new SubstitutionException(Catalog.GetString("No lineup events found"));
            }
            if (subsTime < lineup.EventTime)
            {
                throw new SubstitutionException(Catalog.GetString("A substitution can't happen before the lineup event"));
            }
            se           = new SubstitutionEvent();
            se.EventType = SubstitutionsEventType;
            se.In        = playerIn;
            se.Out       = playerOut;
            se.Reason    = reason;
            se.EventTime = subsTime;
            se.Teams.Add(team);
            Timeline.Add(se);
            return(se);
        }
Beispiel #3
0
        public SubstitutionEvent SubsitutePlayer(Team template, Player playerIn, Player playerOut,
                                                 SubstitutionReason reason, Time subsTime)
        {
            TeamType          team;
            LineupEvent       lineup;
            SubstitutionEvent se;

            if (template == LocalTeamTemplate)
            {
                team = TeamType.LOCAL;
            }
            else
            {
                team = TeamType.VISITOR;
            }
            lineup = Timeline.OfType <LineupEvent> ().FirstOrDefault();
            if (lineup == null)
            {
                throw new SubstitutionException(Catalog.GetString("No lineup events found"));
            }
            if (subsTime < lineup.EventTime)
            {
                throw new SubstitutionException(Catalog.GetString("A substitution can't happen before the lineup event"));
            }
            se           = new SubstitutionEvent();
            se.EventType = SubstitutionsEventType;
            se.In        = playerIn;
            se.Out       = playerOut;
            se.Reason    = reason;
            se.EventTime = subsTime;
            se.Team      = team;
            Timeline.Add(se);
            return(se);
        }
Beispiel #4
0
 public void EmitSubstitutionEvent(Team team, Player p1, Player p2,
                                   SubstitutionReason reason, Time time)
 {
     if (PlayerSubstitutionEvent != null)
     {
         PlayerSubstitutionEvent(team, p1, p2, reason, time);
     }
 }
Beispiel #5
0
 void HandlePlayersSubstitutionEvent(Team team, Player p1, Player p2, SubstitutionReason reason, Time time)
 {
     widget.ReDraw();
     if (PlayersSubstitutionEvent != null)
     {
         PlayersSubstitutionEvent(team, p1, p2, reason, time);
     }
 }
Beispiel #6
0
 void HandlePlayersSubstitutionEvent(Team team, Player p1, Player p2, SubstitutionReason reason, Time time)
 {
     tagger.Substitute(p1, p2, team);
     if (team.ID == homeTeam.ID)
     {
         homeTeam.List.Swap(p1, p2);
     }
     else
     {
         awayTeam.List.Swap(p1, p2);
     }
 }
Beispiel #7
0
        void HandlePlayerSubstitutionEvent(Team team, Player p1, Player p2, SubstitutionReason reason, Time time)
        {
            if (openedProject != null)
            {
                TimelineEvent evt;

                try {
                    evt = openedProject.SubsitutePlayer(team, p1, p2, reason, time);
                    analysisWindow.AddPlay(evt);
                    filter.Update();
                } catch (SubstitutionException ex) {
                    guiToolkit.ErrorMessage(ex.Message);
                }
            }
        }
Beispiel #8
0
        public void EmitSubstitutionEvent(Team team, Player p1, Player p2,
		                                   SubstitutionReason reason, Time time)
        {
            if (PlayerSubstitutionEvent != null) {
                PlayerSubstitutionEvent (team, p1, p2, reason, time);
            }
        }
Beispiel #9
0
        void HandlePlayersSubstitutionEvent(Team team, Player p1, Player p2,
		                                     SubstitutionReason reason, Time time)
        {
            team.List.Swap (p1, p2);
            teamtagger.Substitute (p1, p2, team);
        }
 void HandlePlayersSubstitutionEvent(SportsTeam team, PlayerLongoMatch p1, PlayerLongoMatch p2, SubstitutionReason reason, Time time)
 {
     tagger.Substitute (p1, p2, team);
     if (team.ID == homeTeam.ID) {
         homeTeam.List.Swap (p1, p2);
     } else {
         awayTeam.List.Swap (p1, p2);
     }
 }
        public SubstitutionEvent SubsitutePlayer(SportsTeam team, PlayerLongoMatch playerIn, PlayerLongoMatch playerOut,
		                                          SubstitutionReason reason, Time subsTime)
        {
            LineupEvent lineup;
            SubstitutionEvent se;

            lineup = Timeline.OfType<LineupEvent> ().FirstOrDefault ();
            if (lineup == null) {
                throw new SubstitutionException (Catalog.GetString ("No lineup events found"));
            }
            if (subsTime < lineup.EventTime) {
                throw new SubstitutionException (Catalog.GetString ("A substitution can't happen before the lineup event"));
            }
            se = new SubstitutionEvent ();
            se.EventType = SubstitutionsEventType;
            se.In = playerIn;
            se.Out = playerOut;
            se.Reason = reason;
            se.EventTime = subsTime;
            se.Teams.Add (team);
            Timeline.Add (se);
            return se;
        }
        void HandlePlayersSubstitutionEvent(SportsTeam team, PlayerLongoMatch p1, PlayerLongoMatch p2,
		                                     SubstitutionReason reason, Time time)
        {
            team.List.Swap (p1, p2);
            teamtagger.Substitute (p1, p2, team);
            Edited = true;
        }
Beispiel #13
0
        void HandlePlayersSubstitutionEvent(SportsTeam team, PlayerLongoMatch p1, PlayerLongoMatch p2,
		                                     SubstitutionReason reason, Time time)
        {
            App.Current.EventsBroker.Publish<PlayerSubstitutionEvent> (
                new PlayerSubstitutionEvent {
                    Team = team,
                    Player1 = p1,
                    Player2 = p2,
                    SubstitutionReason = reason,
                    Time = time
                }
            );
        }
Beispiel #14
0
 void HandlePlayersSubstitutionEvent(Team team, Player p1, Player p2,
                                     SubstitutionReason reason, Time time)
 {
     Config.EventsBroker.EmitSubstitutionEvent(team, p1, p2, reason, time);
 }
Beispiel #15
0
        void HandlePlayerSubstitutionEvent(Team team, Player p1, Player p2, SubstitutionReason reason, Time time)
        {
            if (openedProject != null) {
                TimelineEvent evt;

                try {
                    evt = openedProject.SubsitutePlayer (team, p1, p2, reason, time);
                    analysisWindow.AddPlay (evt);
                    filter.Update ();
                } catch (SubstitutionException ex) {
                    guiToolkit.ErrorMessage (ex.Message);
                }
            }
        }
Beispiel #16
0
        void HandlePlayersSubstitutionEvent(SportsTeam team, PlayerLongoMatch p1, PlayerLongoMatch p2,
		                                     SubstitutionReason reason, Time time)
        {
            widget?.ReDraw ();
            if (PlayersSubstitutionEvent != null) {
                PlayersSubstitutionEvent (team, p1, p2, reason, time);
            }
        }