public static Leaf Sequencer(FunctionalList <Leaf> leafList) { return(() => { if (leafList.IsEmpty) { return State.SUCCESS; } else { State headState = leafList.Head(); if (headState == State.SUCCESS) { return Sequencer(leafList.Tail)(); } else { return headState; } } }); }
public static Leaf Selector(FunctionalList <Leaf> leafList) { return(() => { if (leafList.IsEmpty) { return State.FAILURE; } else { State headState = leafList.Head(); if (headState == State.FAILURE) { return Selector(leafList.Tail)(); } else { return headState; } } }); }
public FunctionalList(T head, FunctionalList <T> tail) { IsEmpty = false; Head = head; Tail = tail; }
public static Leaf RandomSelector(FunctionalList <Leaf> leafList) { // placeholder code return(() => { return State.FAILURE; }); }