Files
Yogstation/code/modules/research/techweb/__techweb_helpers.dm
kevinz000 bcf88a2064 Techwebs Backend Refactor - Removes references from techwebs and uses IDs instead (#40596)
Yeah yeah I know no opening too many WIP PRs but this one's [ready] and I want to make sure any furthur techweb development doesn't keep using the old reference system which will make refactoring it harder, and this makes it easier for coders to do stuff in theory (at least for me), standardizes getting a node/design, and makes stuff actually GC properly.
2018-10-05 19:51:10 +01:00

35 lines
1.4 KiB
Plaintext

/proc/count_unique_techweb_nodes()
var/static/list/L = typesof(/datum/techweb_node)
return L.len
/proc/count_unique_techweb_designs()
var/static/list/L = typesof(/datum/design)
return L.len
/proc/node_boost_error(id, message)
WARNING("Invalid boost information for node \[[id]\]: [message]")
SSresearch.invalid_node_boost[id] = message
/proc/techweb_item_boost_check(obj/item/I) //Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()
if(SSresearch.techweb_boost_items[I.type])
return SSresearch.techweb_boost_items[I.type] //It should already be formatted in node datum = list(point type = value)
/proc/techweb_item_point_check(obj/item/I)
if(SSresearch.techweb_point_items[I.type])
return SSresearch.techweb_point_items[I.type]
/proc/techweb_point_display_generic(pointlist)
var/list/ret = list()
for(var/i in pointlist)
if(SSresearch.point_types[i])
ret += "[SSresearch.point_types[i]]: [pointlist[i]]"
else
ret += "ERRORED POINT TYPE: [pointlist[i]]"
return ret.Join("<BR>")
/proc/techweb_point_display_rdconsole(pointlist, last_pointlist)
var/list/ret = list()
for(var/i in pointlist)
ret += "[SSresearch.point_types[i] || "ERRORED POINT TYPE"]: [pointlist[i]] (+[(last_pointlist[i]) * ((SSresearch.flags & SS_TICKER)? (600 / (world.tick_lag * SSresearch.wait)) : (600 / SSresearch.wait))]/ minute)"
return ret.Join("<BR>")