------------------------------------------------------------------------------
-- class 'NoHintNHiddenObjects'
------------------------------------------------------------------------------

class 'NoHintNHiddenObjects' (RSLAchievment)

------------------------------------------------------------------------------
function NoHintNHiddenObjects:__init(game_scene)
	Achievment.__init(self, game_scene)

	self:addEventHandler('on_hint_pressed', bind(self.onHintPressed, self))
	self:addEventHandler('on_help_pressed', bind(self.onHintPressed, self))
	self:addEventHandler('on_ho_completed', bind(self.onHOCompleted, self))

	self.used_hint = false 
	self.num_hidden_objects_completed = 0
	self.num_hidden_objects_to_complete = 1
end

------------------------------------------------------------------------------
function NoHintNHiddenObjects:onHintPressed(args)
	self.used_hint = true
end

------------------------------------------------------------------------------
function NoHintNHiddenObjects:onHOCompleted(args)
	if not self.used_hint then
		self.num_hidden_objects_completed = self.num_hidden_objects_completed + 1
	end
	if self.num_hidden_objects_completed == self.num_hidden_objects_to_complete then
		self:setCompleted(true)
	end
	self.used_hint = false
end