I am trying to program turn-based system, and was thinking on some kind of chain of functions with yield, to ensure that everything is resolved one after another.
But then I realised I don't understand some very fundamental rule about code :
if I do :
func foo():
for x in soldiers:
x.resolve()
than every soldier executes its resolve function independently, fastest code is resolved first.
But what would happen if I do :
func foo():
var whatever
for x in soldiers:
whatever = x.resolve()
Does this mean that loop is now waiting for each soldier to return its resolve function ??
If so, I would need no yields in my design