mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-19 23:01:35 +00:00
* no more spaces * Matthew 10:22 * fixes * dgamerl review * Update code/modules/hydroponics/plant_genes.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * Update code/modules/mob/living/simple_animal/bot/ed209bot.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/pda/PDA.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * fuck * bah * Update tools/ci/check_grep2.py Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * oops * guh --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
25 lines
755 B
Plaintext
25 lines
755 B
Plaintext
GLOBAL_DATUM_INIT(powermonitor_repository, /datum/repository/powermonitor, new())
|
|
|
|
/datum/repository/powermonitor/proc/powermonitor_data(refresh = 0)
|
|
var/pMonData[0]
|
|
|
|
var/datum/cache_entry/cache_entry = cache_data
|
|
if(!cache_entry)
|
|
cache_entry = new/datum/cache_entry
|
|
cache_data = cache_entry
|
|
|
|
if(!refresh)
|
|
return cache_entry.data
|
|
|
|
for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors)
|
|
if(!(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor)
|
|
pMonData[++pMonData.len] = list ("Area" = get_area_name(pMon), "uid" = "[pMon.UID()]")
|
|
|
|
cache_entry.timestamp = world.time //+ 30 SECONDS
|
|
cache_entry.data = pMonData
|
|
return pMonData
|
|
|
|
/datum/repository/powermonitor/proc/update_cache()
|
|
return powermonitor_data(refresh = 1)
|
|
|