Files
YWPolarisVore/code/datums/repositories/decls.dm
T
DatraenandYoshax 3d442044d1 Adds Gene Targetting mode to Floral Somatoray
While I was rooting around in hydroponics code, I saw that a list was being regenerated with UI interaction, so I threw the list into the plant controller.

No proper sprites for the Floral Somatoray's new mode yet, but it uses the gun sprite from mutate mode, and the projectile sprite from yield mode.
2017-05-03 13:33:58 +01:00

39 lines
1.0 KiB
Plaintext

/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