示例#1
0
 public MotionDriver(IMyShipController s, Program p, double m, string t, MotionControllerDeserializer d) : this(s, p, m)
 {
     if (t == null || t.Length == 0)
     {
         return;
     }
     var e = t.Split(":".ToCharArray(), 2); SetController(d(e[1]), double.Parse(e[0]));
 }
示例#2
0
    // Used to construct a motion driver from a saved state
    public MotionDriver(IMyShipController shipController, Program program, double maxSpeed, string serialized, MotionControllerDeserializer deserializer)
        : this(shipController, program, maxSpeed)
    {
        if (serialized == null || serialized.Length == 0)
        {
            return;
        }

        string[] elements = serialized.Split(":".ToCharArray(), 2);
        SetController(deserializer(elements[1]), double.Parse(elements[0]));
    }