[longomatch] Ingore Playing property in the teams editor



commit f241d19284def1148c67d657eca6a5522b06a322
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Dec 6 21:36:46 2014 +0100

    Ingore Playing property in the teams editor

 LongoMatch.Core/Store/Templates/TeamTemplate.cs |   14 ++++++++++++--
 LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs |    1 +
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Templates/TeamTemplate.cs b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
index 8199515..73e7fa8 100644
--- a/LongoMatch.Core/Store/Templates/TeamTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
@@ -130,9 +130,19 @@ namespace LongoMatch.Core.Store.Templates
                }
                
                [JsonIgnore]
+               public bool TemplateEditorMode {
+                       set;
+                       get;
+               }
+
+               [JsonIgnore]
                public List<Player> PlayingPlayersList {
                        get {
-                               return List.Where(p=>p.Playing).Select(p=>p).ToList();
+                               if (TemplateEditorMode) {
+                                       return List;
+                               } else {
+                                       return List.Where(p=>p.Playing).Select(p=>p).ToList();
+                               }
                        }
                }
 
@@ -140,7 +150,7 @@ namespace LongoMatch.Core.Store.Templates
                public List<Player> StartingPlayersList {
                        get {
                                List<Player> playingPlayers = PlayingPlayersList;
-                               int count = Math.Min (StartingPlayers, List.Count);
+                               int count = Math.Min (StartingPlayers, playingPlayers.Count);
                                return playingPlayers.GetRange (0, count);
                        }
                }
diff --git a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
index b4b4783..cfe2584 100644
--- a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
@@ -223,6 +223,7 @@ namespace LongoMatch.Gui.Panel
                        PromptSave ();
                        
                        loadedTeam = team;
+                       team.TemplateEditorMode = true;
                        teamtemplateeditor1.Team = loadedTeam;
                }
 


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