[longomatch/redesign2: 129/159] Add the default team subcategory



commit b58453a155b7a55965ec573d02d9849b0dbea016
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Apr 9 20:23:30 2011 +0200

    Add the default team subcategory

 LongoMatch/Services/TemplatesService.cs |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch/Services/TemplatesService.cs b/LongoMatch/Services/TemplatesService.cs
index 37636e5..f46cbb0 100644
--- a/LongoMatch/Services/TemplatesService.cs
+++ b/LongoMatch/Services/TemplatesService.cs
@@ -35,6 +35,7 @@ namespace LongoMatch.Services
 	{
 		private Dictionary<Type, ITemplateProvider> dict;
 		private List<PlayerSubCategory> playerSubcatList;
+		private List<TeamSubCategory> teamSubcatList;
 		
 		public TemplatesService (string basePath)
 		{
@@ -49,7 +50,8 @@ namespace LongoMatch.Services
 			         new TemplatesProvider<Categories, Category> (basePath,
 			                                                 Constants.CAT_TEMPLATE_EXT));
 			CheckDefaultTemplates();
-			CreateDefaultSubCategories();
+			CreateDefaultPlayerSubCategories();
+			CreateDefaultTeamSubCategories();
 			
 		}
 		
@@ -58,7 +60,7 @@ namespace LongoMatch.Services
 				t.CheckDefaultTemplate();
 		}
 		
-		private void CreateDefaultSubCategories () {
+		private void CreateDefaultPlayerSubCategories () {
 			PlayerSubCategory subcat;
 			
 			/* Local team players */
@@ -81,6 +83,11 @@ namespace LongoMatch.Services
 			subcat.Add(Team.VISITOR);
 			playerSubcatList.Add(subcat);
 		}
+
+		private void CreateDefaultTeamSubCategories () {
+			teamSubcatList = new List<TeamSubCategory>();
+			teamSubcatList.Add(new TeamSubCategory());
+		}
 		
 		public ITemplateProvider<T, U> GetTemplateProvider<T, U>() where T: ITemplate<U> {
 			if (dict.ContainsKey(typeof(T)))
@@ -119,6 +126,12 @@ namespace LongoMatch.Services
 				return playerSubcatList;
 			}
 		}
+		
+		public List<TeamSubCategory> TeamSubcategories {
+			get{
+				return teamSubcatList;
+			}
+		}
 	}
 	
 	public class TemplatesProvider<T, U>: ITemplateProvider<T, U> where T: ITemplate<U>



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