ff_ramp_effect.lua (647B)
1 local base = string.match(..., "(.-)[^%.]+%.[^%.]+$") 2 local ff_envelope = require(base.."ev_api.ff_envelope").new 3 local ffi = require("ffi") 4 local fh = require(base.."helper.ffi_struct") 5 6 local format = string.format 7 8 local mt, index = {}, {} 9 10 fh.gen_raw_accessor(index, "start_level") 11 fh.gen_raw_accessor(index, "end_level") 12 fh.gen_wrap_accessor(index, "envelope", ff_envelope) 13 14 function index:tostring() 15 return format("ff_ramp_effect{start_level=%d, end_level=%d, envelope=%s}", 16 self.start_level, self.end_level, self.envelope) 17 end 18 mt.__tostring = index.tostring 19 20 return fh.base(mt, index, ffi.typeof("struct ff_ramp_effect"))