static Offset <FMotor> serialise_motor(FlatBufferBuilder b, IMotor motor, string identifier) { var n = b.CreateString(identifier); FMotor.StartFMotor(b); FMotor.AddMotorName(b, n); FMotor.AddValidInput( b, FRange.CreateFRange( b, motor.MotionValueSpace._Decimal_Granularity, motor.MotionValueSpace._Max_Value, motor.MotionValueSpace._Min_Value)); FMotor.AddEnergySpentSinceReset(b, motor.GetEnergySpend()); return(FMotor.EndFMotor(b)); }