local this = class("monsterEntity", require(L_EcsConst.aliveType.default))

function this:initialize(monsterEntitydata)
  this.super.initialize(self, monsterEntitydata)
  self.fsmComponent = self:getFsmComponent(true)
  self.stateComponent = self:addComponent(L_EcsConst.componentType.state)
  self.modelControlComponent = self:addComponent(L_EcsConst.componentType.modelControl)
end

function this:bindGameObject(go)
  this.super.bindGameObject(self, go)
  self:getAnimator(true)
end

function this:getEntityData()
  return self.entityData
end

function this:getType()
  return self.entityData.type
end

function this:getId()
  return self.entityData.id
end

function this:getUnitId()
  local id = self.entityData.configId
  local _enemyTpl = L_GameTpl:getEnemyTpl()
  local tpl = _enemyTpl:getTplById(id)
  local unitId = _enemyTpl:getUnitId(tpl)
  return unitId
end

function this:reset()
  self.fsmComponent:reset()
end

function this:getEntityData()
  return self.entityData
end

function this:getId()
  return self.entityData.id
end

function this:getUnitId()
  return self.entityData.unitId
end

function this:transfer(pos, rot)
  self:reset()
  self:putIn(pos, rot)
end

return this
