------------------------------------------------------------------------------
-- class 'CollectNPhoto'
------------------------------------------------------------------------------

class 'CollectNPhoto' (RSLAchievment)

------------------------------------------------------------------------------
function CollectNPhoto:__init(game_scene)
	Achievment.__init(self, game_scene)
	self.name = 'CollectNPhoto'
	self:addEventHandler('on_photo_collect', bind(self.onPhotoCollect, self))

	self.num_photos_to_collect = 1 
	self.num_photos_collected = HasGameState('PHOTO_COLLECTED') and tonumber(GetGameState('PHOTO_COLLECTED'):get(0)) or 0
end

------------------------------------------------------------------------------
function CollectNPhoto:onPhotoCollect(args)
	self.num_photos_collected = HasGameState('PHOTO_COLLECTED') and tonumber(GetGameState('PHOTO_COLLECTED'):get(0)) or 0
	if self.num_photos_collected == self.num_photos_to_collect then
		self:setCompleted(true)
	end
end