feat(flows): stoppet flow tømmer vognen før den parkeres — først ved flowets mål, rest til nærmeste silo/egen fabrik der tager varen, så på plads og hjem (v1.51.4.0)
This commit is contained in:
@@ -66,5 +66,15 @@ check("gæt: andet flow", W.guessWagon("Goat Food", 2, cands, {}), "g1")
|
||||
check("gæt: intet passer", W.guessWagon("Pig Food", 1, cands, {}), nil)
|
||||
check("gæt: store/små bogstaver", W.guessWagon("cow food", 2, cands, {}), "v2")
|
||||
check("gæt: 'Cow Food 1' matcher ikke 'Cow Food 10'", W.guessWagon("Cow Food", 1, {{id = "x", parkName = "P Cow Food vogn 10"}, {id = "y", parkName = "P Cow Food vogn 1"}}, {}), "y")
|
||||
-- tøm vognen før den parkeres (flow stoppet): mål -> silo/fabrik -> hjem
|
||||
check("tøm: tom vogn -> hjem", W.emptyStep("start", {cargo = 0}), "home")
|
||||
check("tøm: last -> flowets mål", W.emptyStep("start", {cargo = 5000, hasTarget = true}), "target")
|
||||
check("tøm: last uden mål -> silo", W.emptyStep("start", {cargo = 5000, hasTarget = false}), "dump")
|
||||
check("tøm: kører stadig -> vent", W.emptyStep("target", {cargo = 5000, adActive = true}), "wait")
|
||||
check("tøm: mål fuldt, rest -> silo", W.emptyStep("target", {cargo = 2000}), "dump")
|
||||
check("tøm: målet tog det hele -> hjem", W.emptyStep("target", {cargo = 0}), "home")
|
||||
check("tøm: silo tog det -> hjem", W.emptyStep("dump", {cargo = 0}), "home")
|
||||
check("tøm: silo kunne ikke -> giv op, hjem", W.emptyStep("dump", {cargo = 2000}), "giveUp")
|
||||
check("tøm: for længe -> giv op", W.emptyStep("target", {cargo = 5000, adActive = true, elapsedMs = W.EMPTY_TIMEOUT_MS}), "giveUp")
|
||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||
os.exit(failures == 0 and 0 or 1)
|
||||
|
||||
Reference in New Issue
Block a user