[longomatch/redesign: 49/82] Rework tags API and subclasses
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch/redesign: 49/82] Rework tags API and subclasses
- Date: Mon, 14 Mar 2011 00:20:56 +0000 (UTC)
commit dea6cfb12729cad2b23c10010c39ece9a1880270
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]