mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 04:48:18 +01:00
7265630dde
Turned a ton of unmanaged globals into managed globals. Refactored some UT output. Removed some unused things, including vars. Added a test to ensure people don't keep adding new unmanaged vars.
34 lines
910 B
Plaintext
34 lines
910 B
Plaintext
GLOBAL_DATUM_INIT(camera_repository, /datum/repository/cameras, new())
|
|
|
|
/proc/invalidateCameraCache()
|
|
GLOB.camera_repository.networks.Cut()
|
|
GLOB.camera_repository.invalidated = 1
|
|
GLOB.camera_repository.camera_cache_id = (++GLOB.camera_repository.camera_cache_id % 999999)
|
|
|
|
/datum/repository/cameras
|
|
var/list/networks
|
|
var/invalidated = 1
|
|
var/camera_cache_id = 1
|
|
|
|
/datum/repository/cameras/New()
|
|
networks = list()
|
|
..()
|
|
|
|
/datum/repository/cameras/proc/cameras_in_network(var/network)
|
|
setup_cache()
|
|
var/list/network_list = networks[network]
|
|
return network_list
|
|
|
|
/datum/repository/cameras/proc/setup_cache()
|
|
if(!invalidated)
|
|
return
|
|
invalidated = 0
|
|
|
|
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
|
var/cam = C.nano_structure()
|
|
for(var/network in C.network)
|
|
if(!networks[network])
|
|
networks[network] = list()
|
|
var/list/netlist = networks[network]
|
|
netlist[++netlist.len] = cam
|