
_G[gTable] = {};

local aTmpVal = gTable;
cm.SetupTable(_G[aTmpVal]);

-- Called on Init
_G[gTable].OnInit = function(pObj)

   -- Move the object by offset
   local aOffX = pObj.mCsData:GetInt("Offx");
   local aOffY = pObj.mCsData:GetInt("Offy");
   local aNewPos = pObj.mSmPos + IcVector2d(aOffX, aOffY);
   pObj.mSmPos = aNewPos;
   
   pObj:SetupParticleSystem("PH_PSYS_SC1_SUNLIGHT");
   pObj:StartParticleEmission(0);
   pObj.mDiscovered = true;

end

-- Called after data being loaded from disk
_G[gTable].OnLoad = function(pObj)
   pObj:SetupParticleSystem("PH_PSYS_SC1_SUNLIGHT");
   pObj:StartParticleEmission(0);
end

-- Called on a update
_G[gTable].OnUpdate = function(pObj)

end

-- Called on a succesful click
_G[gTable].OnClick =  function(pObj, pName)

	return false;
end

-- Called on draw
_G[gTable].OnDraw =  function(pObj, pG)

	local aRpos = pObj.mSmPos;
	local aImg  = IcImageWrap(pObj.mSmallImage);
	assert(aImg);
	local aRect = aImg:GetCelRect(pObj.mCurCell);
	pG:DrawImage(aImg:GetImage(), aRpos.x, aRpos.y, aRect);

end

