local U=require("\109\111\115\101\115")local e=require("\112\108\046\099\108\097\115\115")local Q=require("\115\117\112\112\111\114\116\046\102\097\099\116\111\114\121")CBaseEntity=e()CBaseEntity.entIdx=0 function CBaseEntity._init(R,e)U.extend(R,e or{})if R.entindex==nil then CBaseEntity.entIdx=CBaseEntity.entIdx+1 R.entindex=CBaseEntity.entIdx end R.team=R.team or DOTA_TEAM_NOTEAM R.origin=R.origin or Q.create("\118\101\099\116\111\114",{0,0;0})if R.removed==nil then R.removed=false end if R.alive==nil then R.alive=true end end function CBaseEntity.GetEntityIndex(U)return U.entindex end function CBaseEntity.GetName(U)return U.name end function CBaseEntity.GetClassname(U)return U.classname end function CBaseEntity.RemoveSelf(U)U.removed=true end function CBaseEntity.IsNull(U)return U.removed end function CBaseEntity.IsAlive(U)return U.alive end function CBaseEntity.GetAbsOrigin(U)return U:GetOrigin()end function CBaseEntity.SetAbsOrigin(e,U)e:SetOrigin(U)end function CBaseEntity.GetOrigin(U)return U.origin end function CBaseEntity.SetOrigin(e,U)e.origin=U end function CBaseEntity.GetTeam(U)return U.team end function CBaseEntity.GetTeamNumber(U)return U.team end function CBaseEntity.StopSound(e,U) end function CBaseEntity.SetThink(U) end
local m = require("moses")
local class = require("pl.class")
local Factory = require("support.factory")

-- selene: allow(incorrect_standard_library_use)
CBaseEntity = class()

CBaseEntity.entIdx = 0

function CBaseEntity:_init(attributes)
  m.extend(self, attributes or {})

  if self.entindex == nil then
    CBaseEntity.entIdx = CBaseEntity.entIdx + 1
    self.entindex = CBaseEntity.entIdx
  end

  self.team = self.team or DOTA_TEAM_NOTEAM
  self.origin = self.origin or Factory.create("vector", { 0, 0, 0 })

  if self.removed == nil then
    self.removed = false
  end

  if self.alive == nil then
    self.alive = true
  end
end

function CBaseEntity:GetEntityIndex()
  return self.entindex
end

function CBaseEntity:GetName()
  return self.name
end

function CBaseEntity:GetClassname()
  return self.classname
end

function CBaseEntity:RemoveSelf()
  self.removed = true
end

function CBaseEntity:IsNull()
  return self.removed
end

function CBaseEntity:IsAlive()
  return self.alive
end

function CBaseEntity:GetAbsOrigin()
  return self:GetOrigin()
end

function CBaseEntity:SetAbsOrigin(v)
  self:SetOrigin(v)
end

function CBaseEntity:GetOrigin()
  return self.origin
end

function CBaseEntity:SetOrigin(v)
  self.origin = v
end

function CBaseEntity:GetTeam()
  return self.team
end

function CBaseEntity:GetTeamNumber()
  return self.team
end

function CBaseEntity:StopSound(_soundEvent) end
function CBaseEntity:SetThink() end
