[longomatch/redesign: 116/120] Add team subcategory to the default subcategories



commit 80f85b5da16e340c7b39dceb5181b6fe536e61ae
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Apr 9 18:06:37 2011 +0200

    Add team subcategory to the default subcategories

 LongoMatch/Services/TemplatesService.cs |   34 +++++++++++++++++-------------
 1 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/LongoMatch/Services/TemplatesService.cs b/LongoMatch/Services/TemplatesService.cs
index 37636e5..497e4ab 100644
--- a/LongoMatch/Services/TemplatesService.cs
+++ b/LongoMatch/Services/TemplatesService.cs
@@ -34,7 +34,7 @@ namespace LongoMatch.Services
 	public class TemplatesService
 	{
 		private Dictionary<Type, ITemplateProvider> dict;
-		private List<PlayerSubCategory> playerSubcatList;
+		private List<ISubCategory> defaultSubcatList;
 		
 		public TemplatesService (string basePath)
 		{
@@ -59,27 +59,31 @@ namespace LongoMatch.Services
 		}
 		
 		private void CreateDefaultSubCategories () {
-			PlayerSubCategory subcat;
+			PlayerSubCategory p;
 			
 			/* Local team players */
-			playerSubcatList = new List<PlayerSubCategory>();
-			subcat = new PlayerSubCategory{
+			defaultSubcatList = new List<ISubCategory>();
+			p = new PlayerSubCategory{
 				Name=Catalog.GetString("Local team players"), AllowMultiple=true, FastTag=true};
-			subcat.Add(Team.LOCAL);
-			playerSubcatList.Add(subcat);
+			p.Add(Team.LOCAL);
+			defaultSubcatList.Add(p);
 
 			/* Visitor team players */
-			subcat = new PlayerSubCategory{
+			p = new PlayerSubCategory{
 				Name=Catalog.GetString("Visitor team players"), AllowMultiple=true, FastTag=true};
-			subcat.Add(Team.VISITOR);
-			playerSubcatList.Add(subcat);
+			p.Add(Team.VISITOR);
+			defaultSubcatList.Add(p);
 			
 			/* Local and Visitor team players */
-			subcat = new PlayerSubCategory{
+			p = new PlayerSubCategory{
 				Name=Catalog.GetString("All teams players"), AllowMultiple=true, FastTag=true};
-			subcat.Add(Team.LOCAL);
-			subcat.Add(Team.VISITOR);
-			playerSubcatList.Add(subcat);
+			p.Add(Team.LOCAL);
+			p.Add(Team.VISITOR);
+			defaultSubcatList.Add(p);
+			
+			/* Team selection */
+			var t = new TeamSubCategory();
+			defaultSubcatList.Add(t);
 		}
 		
 		public ITemplateProvider<T, U> GetTemplateProvider<T, U>() where T: ITemplate<U> {
@@ -114,9 +118,9 @@ namespace LongoMatch.Services
 			}
 		}
 		
-		public List<PlayerSubCategory> PlayerSubcategories {
+		public List<ISubCategory> DefaultSubCategories {
 			get{
-				return playerSubcatList;
+				return defaultSubcatList;
 			}
 		}
 	}



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