local LWSoundTemplate = BaseClass("LWSoundTemplate")
local __init = function(self)
  self.id = 0
  self.sound_num = 0
  self.sound_time = 0
  self.sound = {}
  self.soundPath2 = {}
  self.sound_type = 0
  self.sound_set = -1
  self.sound_volume = 1
  self.sound_change = false
  self.reactive = -1
  self.loop_gap = -1
  self.pre_time = -1
  self.speed = 1
  self.usePath2 = false
  self.soundPathTable = {}
end
local __delete = function(self)
  self.id = nil
  self.sound_num = nil
  self.sound_time = nil
  self.sound = nil
  self.soundPath2 = nil
  self.sound_type = nil
  self.sound_set = nil
  self.sound_volume = nil
  self.sound_change = nil
  self.reactive = nil
  self.loop_gap = nil
  self.pre_time = nil
  self.speed = nil
  self.usePath2 = nil
  self.soundPathTable = nil
end
local InitData = function(self, row)
  if row == nil then
    return
  end
  self.id = tonumber(row:getValue("id")) or 0
  self.sound_num = row:getValue("sound_num") or 0
  self.sound_time = row:getValue("sound_time") or 0
  local soundStr = row:getValue("sound")
  self.sound = StringPool.New(soundStr, ";")
  local sound2Str = row:getValue("sound2")
  self.soundPath2 = StringPool.New(sound2Str, ";")
  self.sound_type = tonumber(row:getValue("sound_type")) or 0
  self.sound_set = tonumber(row:getValue("sound_set")) or -1
  self.sound_volume = tonumber(row:getValue("sound_volume")) or 1
  self.sound_change = (tonumber(row:getValue("sound_change")) or 0) == 1
  self.reactive = tonumber(row:getValue("reactive")) or -1
  self.loop_gap = tonumber(row:getValue("loop_gap")) or -1
  self.pre_time = tonumber(row:getValue("pre_time")) or -1
  local speedStr = row:getValue("speed")
  local speedTemp = 1
  if not string.IsNullOrEmpty(speedStr) then
    speedTemp = tonumber(speedStr)
  end
  self.speed = speedTemp
  if string.IsNullOrEmpty(soundStr) and not string.IsNullOrEmpty(sound2Str) then
    self.usePath2 = true
    self.soundPathTable = self.soundPath2.pool
  else
    self.usePath2 = false
  end
end
LWSoundTemplate.__init = __init
LWSoundTemplate.__delete = __delete
LWSoundTemplate.InitData = InitData
return LWSoundTemplate
