[chronojump] LastJumpRjTypeParams class to manage last params of executed Rj



commit 99d2e03314e19f544b6a500f67d82f7933448ee9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 12 12:55:29 2021 +0200

    LastJumpRjTypeParams class to manage last params of executed Rj

 src/sqlite/usefulObjects.cs | 47 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
---
diff --git a/src/sqlite/usefulObjects.cs b/src/sqlite/usefulObjects.cs
index 81750b0f..a7a8437f 100644
--- a/src/sqlite/usefulObjects.cs
+++ b/src/sqlite/usefulObjects.cs
@@ -285,3 +285,50 @@ public class LastJumpSimpleTypeParams
        }
 
 }
+
+public class LastJumpRjTypeParams
+{
+       public int uniqueID;
+       public string name;
+       public int limitedValue; //how many jumps or how many seconds (or none: -1)
+       public bool weightIsPercent;
+       public double weightValue;
+       public int fallmm;
+
+       public LastJumpRjTypeParams(string name)
+       {
+               this.uniqueID = -1;
+               this.name = name;
+               this.limitedValue = -1;
+               this.weightIsPercent = true;
+               this.weightValue = -1;  // has no weight
+               this.fallmm = -1;       // startIn
+       }
+
+       public LastJumpRjTypeParams(int uniqueID, string name, int limitedValue,
+                       bool weightIsPercent, double weightValue, int fallmm)
+       {
+               this.uniqueID = uniqueID;
+               this.name = name;
+               this.limitedValue = limitedValue;
+               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}, {5}",
+                               idString,
+                               name,
+                               limitedValue,
+                               Util.BoolToInt(weightIsPercent),
+                               Util.ConvertToPoint(weightValue),
+                               fallmm);
+       }
+
+}


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