ff_condition_effect.lua (827B)
1 local base = string.match(..., "(.-)[^%.]+%.[^%.]+$") 2 local ffi = require("ffi") 3 local fh = require(base.."helper.ffi_struct") 4 5 local format = string.format 6 7 local mt, index = {}, {} 8 9 fh.gen_raw_accessor(index, "right_saturation") 10 fh.gen_raw_accessor(index, "left_saturation") 11 fh.gen_raw_accessor(index, "right_coeff") 12 fh.gen_raw_accessor(index, "left_coeff") 13 fh.gen_raw_accessor(index, "deadband") 14 fh.gen_raw_accessor(index, "center") 15 16 function index:tostring() 17 return format( 18 "ff_condition_effect{right_saturation=%d, left_saturation=%d, right_coeff=%d, left_coeff=%d, deadband=%d, center=%d}", 19 self.right_saturation, self.left_saturation, 20 self.right_coeff, self.left_coeff, 21 self.deadband, self.center) 22 end 23 mt.__tostring = index.tostring 24 25 return fh.base(mt, index, ffi.typeof("struct ff_condition_effect"))