:: Previous Child In Line

<<silently>>

<<set $i = $cribs.findIndex(function(c) { return c.ID === $activeChild.ID; })>>
<<set $cribs[$i] = $activeChild>> /* save changes before switching */
<<if $i == 0>>
	<<set $activeChild = $cribs[$cribs.length - 1]>>
	<<if $activeChild.actualAge < 3>>
		<<goto "Infant Interact">>
	<<else>>
		<<goto "Child Interact">>
	<</if>>
<<else>>
	<<set $activeChild = $cribs[$i-1]>>
	<<if $activeChild.actualAge < 3>>
		<<goto "Infant Interact">>
	<<else>>
		<<goto "Child Interact">>
	<</if>>
<</if>>

<</silently>>

src/facilities/nursery/previousChildInLine.tw