class 'ProfileManager'

SUCCESS = 0
ERROR_PROFILE_EXISTS = 1
ERROR_MAX_PLAYERS_REACHED = 2

function OnScenePreLoad(screen)
    OnSceneLoad(screen)
end

function RemoveObject(object_name)    
    play_field:DeleteObject(object_name)
    GetProfileManager():GetCurrentProfile():AddFoundObject(object_name)
end

function OnSceneStateChanged(screen)    
	local pm = GetProfileManager()
	local currentLevel = screen:GetLevelScreen()
	local currentProfile = pm:GetCurrentProfile();
	currentProfile:SetActualTasks(currentLevel:GetTasks());
	currentProfile:SetLevelToLoad(play_field:GetName());
	currentProfile:SetGameState(game_state)
	currentProfile.hint_delay_ = panel:GetHintDelay()
	--currentProfile:SetActualObjects(play_field:GetObjects());
	pm:SaveProfiles();
end

function GetProfileManager()
	if profile_manager == nil then
		profile_manager = ProfileManager()
	end
	return profile_manager
end

