[longomatch/redesign: 48/75] Rework tags API and subclasses



commit b31866f104dd46c0405d6b58a4e2b1995f74b55b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jan 27 00:38:37 2011 +0100

    Rework tags API and subclasses

 LongoMatch/Store/Tag.cs |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/LongoMatch/Store/Tag.cs b/LongoMatch/Store/Tag.cs
index 3eeaad7..b810078 100644
--- a/LongoMatch/Store/Tag.cs
+++ b/LongoMatch/Store/Tag.cs
@@ -17,6 +17,7 @@
 //
 
 using System;
+using LongoMatch.Common;
 
 namespace LongoMatch.Store
 {
@@ -27,7 +28,7 @@ namespace LongoMatch.Store
 		public Tag() {
 		}
 
-		public string SubCategory {
+		public string Name {
 			get;
 			set;
 		}
@@ -36,23 +37,29 @@ namespace LongoMatch.Store
 			get;
 			set;
 		}
-
-		public bool Equals(Tag tagComp) {
-			return (SubCategory == tagComp.SubCategory && Value == tagComp.Value);
+	}
+	
+	[Serializable]
+	public class PlayerTag:Tag
+	{
+		public PlayerTag() {
 		}
-
-		public override bool Equals(object obj)
-		{
-			Tag tag= obj as Tag;
-			if (tag != null)
-				return Equals(tag);
-			else
-				return false;
+		
+		public new Player Value {
+			get;
+			set;
 		}
-
-		public override int GetHashCode()
-		{
-			return SubCategory.GetHashCode() + Value.GetHashCode();
+	}
+	
+	[Serializable]
+	public class TeamTag:Tag
+	{
+		public TeamTag() {
+		}
+		
+		public new Team Value {
+			get;
+			set;
 		}
 	}
 }



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