mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 12:29:23 +01:00
Refactored the abstract meta propriety (#19797)
Refactored the abstract meta propriety into defines. It's now more easy to spot/see abstract types thanks to the macro that defines them. Added a check on initialization of atoms to avoid spawning abstract types. Made the spawn_atom proc check for abstractness. Made the spawn_atom proc use tgui_list for types list shorter than 1000 elements, which enables to search in them. It's too laggy on larger lists so above 1000 it uses the builtin input. Made the spawn_atom use a list subtraction instead of a double list, it's lighter on memory and processing.
This commit is contained in:
@@ -185,6 +185,10 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
|
||||
GLOB.running_create_and_destroy = TRUE
|
||||
for(var/type_path in typesof(/atom/movable, /turf) - ignore) //No areas please
|
||||
|
||||
//No abstract types
|
||||
if(is_abstract(type_path))
|
||||
continue
|
||||
|
||||
TEST_DEBUG("[name]: now creating and destroying: [type_path]")
|
||||
|
||||
if(ispath(type_path, /turf))
|
||||
|
||||
@@ -41,8 +41,7 @@ var/ascii_reset = "[ascii_esc]\[0m"
|
||||
// We list these here so we can remove them from the for loop running this.
|
||||
// Templates aren't intended to be ran but just serve as a way to create child objects of it with inheritable tests for quick test creation.
|
||||
|
||||
/datum/unit_test
|
||||
abstract_type = /datum/unit_test
|
||||
ABSTRACT_TYPE(/datum/unit_test)
|
||||
var/name = "template - should not be ran."
|
||||
var/disabled = 0 // If we want to keep a unit test in the codebase but not run it for some reason.
|
||||
var/async = 0 // If the check can be left to do it's own thing, you must define a check_result() proc if you use this.
|
||||
|
||||
Reference in New Issue
Block a user