mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-20 11:32:51 +01:00
Merge pull request #3408 from Yoshax/floralsomatoray
Adds Gene Targetting mode to Floral Somatoray
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/var/repository/decls/decls_repository = new()
|
||||
|
||||
/repository/decls
|
||||
var/list/fetched_decls
|
||||
var/list/fetched_decl_types
|
||||
var/list/fetched_decl_subtypes
|
||||
|
||||
/repository/decls/New()
|
||||
..()
|
||||
fetched_decls = list()
|
||||
fetched_decl_types = list()
|
||||
fetched_decl_subtypes = list()
|
||||
|
||||
/repository/decls/proc/decls_of_type(var/decl_prototype)
|
||||
. = fetched_decl_types[decl_prototype]
|
||||
if(!.)
|
||||
. = get_decls(typesof(decl_prototype))
|
||||
fetched_decl_types[decl_prototype] = .
|
||||
|
||||
/repository/decls/proc/decls_of_subtype(var/decl_prototype)
|
||||
. = fetched_decl_subtypes[decl_prototype]
|
||||
if(!.)
|
||||
. = get_decls(subtypesof(decl_prototype))
|
||||
fetched_decl_subtypes[decl_prototype] = .
|
||||
|
||||
/repository/decls/proc/get_decl(var/decl_type)
|
||||
. = fetched_decls[decl_type]
|
||||
if(!.)
|
||||
. = new decl_type()
|
||||
fetched_decls[decl_type] = .
|
||||
|
||||
/repository/decls/proc/get_decls(var/list/decl_types)
|
||||
. = list()
|
||||
for(var/decl_type in decl_types)
|
||||
.[decl_type] = get_decl(decl_type)
|
||||
|
||||
/decls/Destroy()
|
||||
crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]")
|
||||
return 1 // Prevents Decl destruction
|
||||
@@ -1,4 +1,19 @@
|
||||
/repository/New()
|
||||
return
|
||||
|
||||
/datum/cache_entry
|
||||
var/timestamp
|
||||
var/data
|
||||
|
||||
/datum/cache_entry/New()
|
||||
timestamp = world.time
|
||||
|
||||
/datum/cache_entry/proc/is_valid()
|
||||
return FALSE
|
||||
|
||||
/datum/cache_entry/valid_until/New(var/valid_duration)
|
||||
..()
|
||||
timestamp += valid_duration
|
||||
|
||||
/datum/cache_entry/valid_until/is_valid()
|
||||
return world.time < timestamp
|
||||
Reference in New Issue
Block a user