class 'p01_l03_z04_disk'

function p01_l03_z04_disk:__init()
 self.object=nil
self.tween=nil
self.tweenSel=nil
self.type=nil
self.senter=nil
self.diameter=nil
self.direction=nil
self.selObject=nil

self.arrCell={}
end

function p01_l03_z04_disk:setObject(obj)
 self.object=obj
end
function p01_l03_z04_disk:getObject()
 return self.object
end

function p01_l03_z04_disk:setSelObject(obj)
 self.selObject=obj
end
function p01_l03_z04_disk:getSelObject()
 return self.selObject
end


function p01_l03_z04_disk:setStartPos(param)
 self.startPos=param
end
function p01_l03_z04_disk:getStartPos()
 return self.startPos
end

function p01_l03_z04_disk:setTween(param)
 self.tween=param
end
function p01_l03_z04_disk:getTween()
 return self.tween
end

function p01_l03_z04_disk:setTweenSel(param)
self.tweenSel=param
end
function p01_l03_z04_disk:getTweenSel()
 return self.tweenSel
end


function p01_l03_z04_disk:setType(param)
 self.type=param
end
function p01_l03_z04_disk:getType()
 return self.type
end

function p01_l03_z04_disk:setArrCell(param)
 self.arrCell=param
end
function p01_l03_z04_disk:getArrCell()
 return self.arrCell
end

function p01_l03_z04_disk:setSenter(param)
 self.senter=param
end
function p01_l03_z04_disk:getSenter()
 return self.senter
end

function p01_l03_z04_disk:setRadius(param)
 self.diameter=param
end
function p01_l03_z04_disk:getRadius()
 return self.diameter
end

function p01_l03_z04_disk:setDirection(param)
 self.direction=param
end
function p01_l03_z04_disk:getDirection()
 return self.direction
end

function p01_l03_z04_disk:rotateSfere(speed,distanse,direction)

 for i=1,#self.arrCell do
  self.arrCell[i].object.tween:setParamsRotateTr(self.arrCell[i].object.object,100,distanse,
    (-1)*direction,self:getRotationSenterSphere(self.arrCell[i].object),self.arrCell[i].startAngel)
    wnd_print(self.arrCell[i].object.object:name())
 end

end

function p01_l03_z04_disk:getRotationSenterSphere(obj)
  local senter
   --senter=Position(self.senter:x()-obj.object:position():x(),self.senter:y()-obj.object:position():y())
   senter = Position(self.senter:x()-20,self.senter:y()-20)
   return senter
end

function p01_l03_z04_disk:exchangeSfere()
  local arrSfere={}
  for i=1,#self.arrCell do
   arrSfere[i]=self.arrCell[i].object
  end
  if self.direction==1 then
    table.insert(arrSfere,arrSfere[1])
    table.remove(arrSfere,1)
  end
  if self.direction==-1 then
      table.insert(arrSfere,1,arrSfere[#arrSfere])
      table.remove(arrSfere,#arrSfere)
  end
  for i=1,#self.arrCell do
   self.arrCell[i].object=arrSfere[i]
  end

end








