[chronojump] LastJumpSimpleType class to remember config of jump type done



commit 97a68072df629577322d8d0b78acd8363208de34
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 9 17:17:50 2021 +0200

    LastJumpSimpleType class to remember config of jump type done

 src/sqlite/usefulObjects.cs | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
---
diff --git a/src/sqlite/usefulObjects.cs b/src/sqlite/usefulObjects.cs
index 601e60f8..81750b0f 100644
--- a/src/sqlite/usefulObjects.cs
+++ b/src/sqlite/usefulObjects.cs
@@ -242,3 +242,46 @@ public class SelectRunITypes : SelectRunTypes
        }
 
 }
+
+public class LastJumpSimpleTypeParams
+{
+       public int uniqueID;
+       public string name;
+       public bool weightIsPercent;
+       public double weightValue;
+       public int fallmm;
+
+       public LastJumpSimpleTypeParams(string name)
+       {
+               this.uniqueID = -1;
+               this.name = name;
+               this.weightIsPercent = true;
+               this.weightValue = -1;  // has no weight
+               this.fallmm = -1;       // startIn
+       }
+
+       public LastJumpSimpleTypeParams(int uniqueID, string name,
+                       bool weightIsPercent, double weightValue, int fallmm)
+       {
+               this.uniqueID = uniqueID;
+               this.name = name;
+               this.weightIsPercent = weightIsPercent;
+               this.weightValue = weightValue;
+               this.fallmm = fallmm;
+       }
+
+       public string ToSqlString()
+       {
+               string idString = "NULL";
+               if(uniqueID != -1)
+                       idString = uniqueID.ToString();
+
+               return string.Format("{0}, \"{1}\", {2}, {3}, {4}",
+                               idString,
+                               name,
+                               Util.BoolToInt(weightIsPercent),
+                               Util.ConvertToPoint(weightValue),
+                               fallmm);
+       }
+
+}


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