local registred_items = {}
-- Outfits ---------------------------------------------------------------------
class "se_outfit" (cse_alife_item_custom_outfit)
function se_outfit:__init (section) super (section)
	self.secret_item = false
end
function se_outfit:on_register()
	cse_alife_item_custom_outfit.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_outfit:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_custom_outfit.on_unregister( self )
end
function se_outfit:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_custom_outfit.can_switch_online(self)
end

class "se_helmet" (cse_alife_item_helmet)
function se_helmet:__init (section) super (section)
	self.secret_item = false
end
function se_helmet:on_register()
	cse_alife_item_helmet.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_helmet:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_helmet.on_unregister( self )
end
function se_helmet:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_helmet.can_switch_online(self)
end

-- Weapons ---------------------------------------------------------------------
class "se_weapon" (cse_alife_item_weapon)
function se_weapon:__init (section) super (section)
	self.secret_item = false
end
function se_weapon:on_register()
	cse_alife_item_weapon.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)


	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_weapon:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_weapon.on_unregister( self )
end
function se_weapon:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_weapon.can_switch_online(self)
end

class "se_weapon_shotgun" (cse_alife_item_weapon_shotgun)
function se_weapon_shotgun:__init (section) super (section)
	self.secret_item = false
end
function se_weapon_shotgun:on_register()
	cse_alife_item_weapon_shotgun.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_weapon_shotgun:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_weapon_shotgun.on_unregister( self )
end
function se_weapon_shotgun:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_weapon_shotgun.can_switch_online(self)
end

class "se_weapon_automatic_shotgun" (cse_alife_item_weapon_auto_shotgun)
function se_weapon_automatic_shotgun:__init (section) super (section)
	self.secret_item = false
end
function se_weapon_automatic_shotgun:on_register()
	cse_alife_item_weapon_auto_shotgun.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_weapon_automatic_shotgun:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_weapon_auto_shotgun.on_unregister( self )
end
function se_weapon_automatic_shotgun:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_weapon_auto_shotgun.can_switch_online(self)
end

class "se_weapon_magazined" (cse_alife_item_weapon_magazined)
function se_weapon_magazined:__init (section) super (section)
	self.secret_item = false
end
function se_weapon_magazined:on_register()
	cse_alife_item_weapon_magazined.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_weapon_magazined:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_weapon_magazined.on_unregister( self )
end
function se_weapon_magazined:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_weapon_magazined.can_switch_online(self)
end

class "se_weapon_magazined_w_gl" (cse_alife_item_weapon_magazined_w_gl)
function se_weapon_magazined_w_gl:__init (section) super (section)
	self.secret_item = false
end
function se_weapon_magazined_w_gl:on_register()
	cse_alife_item_weapon_magazined_w_gl.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_weapon_magazined_w_gl:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_weapon_magazined_w_gl.on_unregister( self )
end
function se_weapon_magazined_w_gl:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_weapon_magazined_w_gl.can_switch_online(self)
end

-- Items -----------------------------------------------------------------------
class "se_item"	(cse_alife_item)
function se_item:__init (section) super (section)
	self.secret_item = false
end
function se_item:on_register()
	cse_alife_item.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_item:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item.on_unregister( self )
end
function se_item:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item.can_switch_online(self)
end

class "se_item_torch" (cse_alife_item_torch)
function se_item_torch:__init (section) super (section)
	self.secret_item = false
end
function se_item_torch:on_register()
	cse_alife_item_torch.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_item_torch:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_torch.on_unregister( self )
end
function se_item_torch:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_torch.can_switch_online(self)
end

--' ФИзобъекты
class "se_physic" (cse_alife_object_physic)
function se_physic:__init (section) super (section)
	self.secret_item = false
end
function se_physic:on_register()
	cse_alife_object_physic.on_register(self)
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_physic:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_object_physic.on_unregister(self)
end
function se_physic:keep_saved_data_anyway()
	return true
end
function se_physic:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_object_physic.can_switch_online(self)
end

class "se_lamp" (cse_alife_object_hanging_lamp)
function se_lamp:__init (section) super (section)
	self.secret_item = false
end
function se_lamp:on_register()
	cse_alife_object_hanging_lamp.on_register(self)
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_lamp:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_object_hanging_lamp.on_unregister(self)
end
function se_lamp:keep_saved_data_anyway()
	return true
end
function se_lamp:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_object_hanging_lamp.can_switch_online(self)
end




-- AMMO ------------------------------------------------------------------------
class "se_ammo" (cse_alife_item_ammo)
function se_ammo:__init (section) super (section)
	self.secret_item = false
end

function se_ammo:on_register()
	cse_alife_item_ammo.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_ammo:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_item_ammo.on_unregister(self)
end
function se_ammo:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_ammo.can_switch_online(self)
end
 -- IX-Ray START
function se_ammo:keep_saved_data_anyway()
	return false
end
 -- IX-Ray END
-- GRENADES --------------------------------------------------------------------------------------------------------------------------
class "se_grenade" (cse_alife_item_grenade)
function se_grenade:__init (section) super (section)
	self.secret_item = false
end

function se_grenade:on_register()
	cse_alife_item_grenade.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_grenade:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_item_grenade.on_unregister(self)
end
function se_grenade:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_grenade.can_switch_online(self)
end
-- EATEBLE ---------------------------------------------------------------------------------------------------------------------------
class "se_eatable" (cse_alife_item)
function se_eatable:__init (section) super (section)
	self.secret_item = false
end

function se_eatable:on_register()
	cse_alife_item.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_eatable:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_item.on_unregister(self)
end
function se_eatable:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item.can_switch_online(self)
end

-- INVENTORY BOX ---------------------------------------------------------------------------------------------------------------------
class "se_invbox" (cse_alife_inventory_box)
function se_invbox:__init (section) super (section)
	self.secret_item = false
end

function se_invbox:on_register()
	cse_alife_inventory_box.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_invbox:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_inventory_box.on_unregister(self)
end
function se_invbox:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_inventory_box.can_switch_online(self)
end

-- EXPLOSIVE -------------------------------------------------------------------------------------------------------------------------
class "se_explosive" (cse_alife_item_explosive)
function se_explosive:__init (section) super (section)
	self.secret_item = false
end

function se_explosive:on_register()
	cse_alife_item_explosive.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_explosive:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_item_explosive.on_unregister(self)
end
function se_explosive:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_explosive.can_switch_online(self)
end

-- PDA -------------------------------------------------------------------------------------------------------------------------------
class "se_pda" (cse_alife_item_pda)
function se_pda:__init (section) super (section)
	self.secret_item = false
end

function se_pda:on_register()
	cse_alife_item_pda.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end

function se_pda:on_unregister()
	unregister_story_object_by_id(self.id)
	cse_alife_item_pda.on_unregister(self)
end
function se_pda:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_pda.can_switch_online(self)
end

class "se_detector" (cse_alife_item_detector)
function se_detector:__init (section) super (section)
	self.secret_item = false
end
function se_detector:on_register()
	cse_alife_item_detector.on_register( self )
	-- Проверяем кастомдату обьекта на наличие стори айди.
	story_objects.check_spawn_ini_for_story_id(self)
	-- Собираем статистику по предметам.
	if registred_items[self:section_name()] == nil then
		registred_items[self:section_name()] = 1
	else
		registred_items[self:section_name()] = registred_items[self:section_name()] + 1
	end

	self.secret_item = treasure_manager.get_treasure_manager():register_item(self)
end
function se_detector:on_unregister()
	--' Отрегистрация в таскменеджере
	unregister_story_object_by_id(self.id)
	cse_alife_item_detector.on_unregister( self )
end
function se_detector:can_switch_online()
	if(self.secret_item) then
		return false
	end
	return cse_alife_item_detector.can_switch_online(self)
end


--------------------------------------------------------------------------------
function stats()
	printf("*** SIM ITEMS STATISTIC ***")
	for k,v in pairs(registred_items) do
		printf("item = %s, num = %s", k, v)
	end
end
