Abstract away stuff that acts on baseturfs directly into their own procs, and kills some dead code related to baseturfs + tests (#72117)

Adds some new procs relating to baseturfs that replaces some code that
reads and sets them directly. Moves them to their own file. **To
reviewers: Any proc in baseturfs.dm that is snake_case is mine, anything
else is just moved**.

Adds tests for the existing procs of baseturfs.

I'm going to be doing some optimizations to baseturfs that change the
actual representation of baseturfs, and so I'm prepping these to be
implementation agnostic.

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
Mothblocks
2022-12-27 06:29:49 +00:00
committed by GitHub
co-authored by LemonInTheDark
parent 5e69584692
commit 45dcc6e72b
16 changed files with 284 additions and 169 deletions
+2 -16
View File
@@ -34,22 +34,8 @@
qdel(src)
/obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
if(length(thing.baseturfs))
var/list/baseturf_cache = thing.baseturfs.Copy()
for(var/i in baseturf_cache)
if(baseturf_to_replace[i])
baseturf_cache -= i
thing.baseturfs = baseturfs_string_list(baseturf_cache, thing)
if(!baseturf_cache.len)
thing.assemble_baseturfs(baseturf)
else
thing.PlaceOnBottom(null, baseturf)
else if(baseturf_to_replace[thing.baseturfs])
thing.assemble_baseturfs(baseturf)
else
thing.PlaceOnBottom(null, baseturf)
thing.remove_baseturfs_from_typecache(baseturf_to_replace)
thing.PlaceOnBottom(fake_turf_type = baseturf)
/obj/effect/baseturf_helper/space
name = "space baseturf editor"