[longomatch] Add helper to set default postion tags



commit 65c546c40dca1c604dec50560935b83df4ea4eed
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jun 19 14:29:45 2014 +0200

    Add helper to set default postion tags

 LongoMatch.Core/Store/Play.cs |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Play.cs b/LongoMatch.Core/Store/Play.cs
index 27265fe..b54d420 100644
--- a/LongoMatch.Core/Store/Play.cs
+++ b/LongoMatch.Core/Store/Play.cs
@@ -182,6 +182,34 @@ namespace LongoMatch.Store
 
                #region Public methods
                
+               public void AddDefaultPositions () {
+                       if (Category.TagFieldPosition) {
+                               if (FieldPosition == null) {
+                                       FieldPosition = new Coordinates ();
+                                       FieldPosition.Points.Add (new Point (0.5, 0.5));
+                               }
+                               if (Category.FieldPositionIsDistance) {
+                                       FieldPosition.Points.Add (new Point (0.5, 0.1));
+                               }
+                       }
+                       if (Category.TagHalfFieldPosition) {
+                               if (HalfFieldPosition == null) {
+                                       HalfFieldPosition = new Coordinates ();
+                                       HalfFieldPosition.Points.Add (new Point (0.5, 0.5));
+                               }
+                               if (Category.HalfFieldPositionIsDistance) {
+                                       HalfFieldPosition.Points.Add (new Point (0.5, 0.1));
+                               }
+                       }
+                       
+                       if (Category.TagGoalPosition) {
+                               if (GoalPosition == null) {
+                                       GoalPosition = new Coordinates ();
+                                       GoalPosition.Points.Add (new Point (0.5, 0.5));
+                               }
+                       }
+               }
+               
                public Coordinates CoordinatesInFieldPosition (FieldPositionType pos) {
                        switch (pos) {
                        case FieldPositionType.Field:


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