mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-20 19:27:31 +01:00
tl;dr level collections that can easily be logically restructured/moved as necessary will eventually be used for radio and overmaps location resolution. this is the last part of https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/4841 that has not yet been integrated. this will be a draft for a while. --------- Co-authored-by: LetterN <24603524+LetterN@users.noreply.github.com>
47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
//* This file is explicitly licensed under the MIT license. *//
|
|
//* Copyright (c) 2024 Citadel Station Developers *//
|
|
|
|
//* Attributes *//
|
|
|
|
/**
|
|
* Returns the z indices of levels with a certain attribute set to a certain value
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/levels_by_attribute(key, value)
|
|
RETURN_TYPE(/list)
|
|
. = list()
|
|
for(var/datum/map_level/L as anything in ordered_levels)
|
|
if(L.get_attribute(key) == value)
|
|
. += L.z_index
|
|
|
|
//* Traits *//
|
|
|
|
/**
|
|
* Returns a list of z indices with a trait
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/levels_by_trait(trait)
|
|
RETURN_TYPE(/list)
|
|
. = list()
|
|
for(var/datum/map_level/L as anything in ordered_levels)
|
|
if(L.has_trait(trait))
|
|
. += L.z_index
|
|
|
|
/**
|
|
* Returns a list of z indices with any of these traits
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/levels_by_any_trait(list/traits)
|
|
RETURN_TYPE(/list)
|
|
. = list()
|
|
for(var/datum/map_level/L as anything in ordered_levels)
|
|
if(length(L.traits & traits))
|
|
. += L.z_index
|
|
|
|
/**
|
|
* Returns a list of z indices with any of these traits
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/levels_by_all_traits(list/traits)
|
|
RETURN_TYPE(/list)
|
|
. = list()
|
|
for(var/datum/map_level/L as anything in ordered_levels)
|
|
if(!length(traits - L.traits))
|
|
. += L.z_index
|