mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-10 15:36:47 +01:00
290032afc7
Hydroponics tray processing is a massive chunk of machinery processing for no good reason, I have a sneaking suspicion that this is due to proc overhead on get_trait, as process can call it upwards of 30 times per tick per tray. Realistically most of the things that are traits should instead be variables, but that's a refactor for someone with more time.
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
/*
|
|
For unit tests relating to hydroponics mechanics, with no direct relation to cooking.
|
|
*/
|
|
|
|
/**
|
|
Checks if the preference values of a seed are lesser than their tolerance values.
|
|
Preferences should always be within tolerances. We don't want any plant to be dying from intolerance
|
|
while simultaneously growing faster from being within its preferences.
|
|
*/
|
|
/datum/unit_test/seed_preferences_check
|
|
name = "HYDROPONICS: Check preference and tolerance validity"
|
|
groups = list("generic", "cooking")
|
|
|
|
/datum/unit_test/seed_preferences_check/start_test()
|
|
for(var/seed_name in SSplants.seeds)
|
|
var/datum/seed/S = SSplants.seeds[seed_name]
|
|
|
|
if(GET_SEED_TRAIT(S, TRAIT_LIGHT_TOLERANCE) < GET_SEED_TRAIT(S, TRAIT_LIGHT_PREFERENCE))
|
|
TEST_FAIL("Seed [S] has a light preference value set higher than its light tolerance.")
|
|
|
|
if(GET_SEED_TRAIT(S, TRAIT_HEAT_TOLERANCE) < GET_SEED_TRAIT(S, TRAIT_HEAT_PREFERENCE))
|
|
TEST_FAIL("Seed [S] has a heat preference value set higher than its heat tolerance.")
|
|
|
|
if(!reported)
|
|
TEST_PASS("All seeds have preference values that are lower than their tolerance values.")
|
|
|
|
return 1
|