[longomatch] Use the name of the score or the penalty to create the event



commit 35712118370ed6d9a246f437e418345d5796726e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Sep 8 18:57:33 2014 +0200

    Use the name of the score or the penalty to create the event

 LongoMatch.Core/Store/Project.cs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index 5a84e56..2fe04c2 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -179,14 +179,18 @@ namespace LongoMatch.Core.Store
                                             Score score, PenaltyCard card, bool addToTimeline=true)
                {
                        TimelineEvent evt;
-                       string count = String.Format ("{0:000}", EventsByType (type).Count + 1);
-                       string name = String.Format ("{0} {1}", type.Name, count);
+                       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 ();
                        }
                        


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]