[longomatch] Include team's shield in the project description



commit a9e6cab4b7c165b90b09b16f9811beb90102d50a
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Nov 13 17:20:28 2014 +0100

    Include team's shield in the project description

 LongoMatch.Core/Store/Project.cs            |   10 ++++++++++
 LongoMatch.Core/Store/ProjectDescription.cs |   19 +++++++++++++++++++
 LongoMatch.Services/Services/FileDB.cs      |    2 +-
 3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index 46a6a7c..899197f 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -433,6 +433,16 @@ namespace LongoMatch.Core.Store
                        return null;
                }
 
+               public void ConsolidateDescription () {
+                       Description.LastModified = DateTime.UtcNow;
+                       Description.LocalName = LocalTeamTemplate.Name;
+                       Description.LocalShield = LocalTeamTemplate.Shield;
+                       Description.LocalGoals = GetScore (Team.LOCAL);
+                       Description.VisitorName = VisitorTeamTemplate.Name;
+                       Description.VisitorShield = VisitorTeamTemplate.Shield;
+                       Description.VisitorGoals = GetScore (Team.VISITOR);
+               }
+
                public bool Equals(Project project) {
                        if(project == null)
                                return false;
diff --git a/LongoMatch.Core/Store/ProjectDescription.cs b/LongoMatch.Core/Store/ProjectDescription.cs
index 59729ff..5db5f07 100644
--- a/LongoMatch.Core/Store/ProjectDescription.cs
+++ b/LongoMatch.Core/Store/ProjectDescription.cs
@@ -20,6 +20,7 @@ using System;
 using Newtonsoft.Json;
 using LongoMatch.Core.Store;
 using LongoMatch.Core.Interfaces;
+using LongoMatch.Core.Common;
 
 namespace LongoMatch.Core.Store
 {
@@ -125,6 +126,24 @@ namespace LongoMatch.Core.Store
                }
 
                /// <summary>
+               /// Gets or sets the shield for the local team.
+               /// </summary>
+               /// <value>The local team shield.</value>
+               public Image LocalShield {
+                       get;
+                       set;
+               }
+
+               /// <summary>
+               /// Gets or sets the shield for the visitor team.
+               /// </summary>
+               /// <value>The visitor team shield.</value>
+               public Image VisitorShield {
+                       get;
+                       set;
+               }
+
+               /// <summary>
                /// Date of the game
                /// </summary>
                public DateTime MatchDate {
diff --git a/LongoMatch.Services/Services/FileDB.cs b/LongoMatch.Services/Services/FileDB.cs
index 48f0539..7b96f82 100644
--- a/LongoMatch.Services/Services/FileDB.cs
+++ b/LongoMatch.Services/Services/FileDB.cs
@@ -186,7 +186,7 @@ namespace LongoMatch.DB
 
                public void UpdateProject (Project project)
                {
-                       project.Description.LastModified = DateTime.UtcNow;
+                       project.ConsolidateDescription ();
                        AddProject (project);
                }
 


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