[longomatch/redesign3: 24/143] Clean up the players list using a lsit for each team
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch/redesign3: 24/143] Clean up the players list using a lsit for each team
- Date: Mon, 15 Aug 2011 22:47:13 +0000 (UTC)
commit 3b601384a6548f43e528cc967ef586ea1aaf22b1
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Nov 28 17:53:30 2010 +0100
Clean up the players list using a lsit for each team
LongoMatch/Time/Play.cs | 61 ++++-------------------------------------------
1 files changed, 5 insertions(+), 56 deletions(-)
---
diff --git a/LongoMatch/Time/Play.cs b/LongoMatch/Time/Play.cs
index 59b8087..2d09a3c 100644
--- a/LongoMatch/Time/Play.cs
+++ b/LongoMatch/Time/Play.cs
@@ -38,7 +38,6 @@ namespace LongoMatch.TimeNodes
#region Constructors
public Play(){
- Players = new List<Player>();
Tags = new List<Tag>();
}
#endregion
@@ -121,51 +120,21 @@ namespace LongoMatch.TimeNodes
get;
set;
}
-
- /// <summary>
- /// Get/Set a list of the players tagged to this play
- /// </summary>
- public List<Player> Players {
- get;
- set;
- }
/// <summary>
/// Gets a list of players for the local team
/// </summary>
public List<Player> LocalPlayers {
- get{
- return
- (from player in Players
- where player.Team == Team.LOCAL
- select player
- ).ToList();
- }
- /* FIXME: should an array for each team */
- set {
- var l = VisitorPlayers;
- l.AddRange(value);
- Players = l;
- }
+ get;
+ set;
}
/// <summary>
/// Gets a list of players for the visitor team
/// </summary>
public List<Player> VisitorPlayers {
- get{
- return
- (from player in Players
- where player.Team == Team.VISITOR
- select player
- ).ToList();
- }
-
- set {
- var l = LocalPlayers;
- l.AddRange(value);
- Players = l;
- }
+ get;
+ set;
}
/// <summary>
@@ -227,27 +196,7 @@ namespace LongoMatch.TimeNodes
}
public bool HasPlayer(Player player){
- return Players.Contains(player);
- }
-
- /// <summary>
- /// Add a player to the player's list
- /// </summary>
- /// <param name="player">
- /// The <see cref="LongoMatch.TimeNode.Player"/> to add
- /// </param>
- public void AddPlayer(Player player) {
- Players.Add(player);
- }
-
- /// <summary>
- /// Removes a player from the player's list
- /// </summary>
- /// <param name="player">
- /// The <see cref="LongoMatch.TimeNode.Player"/> to remove
- /// </param>
- public void RemovePlayer(Player Player) {
- Players.Remove(Player);
+ return LocalPlayers.Contains(player) || VisitorPlayers.Contains(player);
}
/// <summary>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]