public static List <Action> actionsFromNodes(List <Node> nodeList) { List <Action> actions = new List <Action>(); if (nodeList.Count == 1) { // I'm at the root node, this indicates I started at the // Goal node, therefore just return a NoOp actions.Add(NoOpAction.NO_OP); } else { // ignore the root node this has no action // hence index starts from 1 not zero for (int i = 1; i < nodeList.Count; i++) { Node node = nodeList[i]; actions.Add(node.getAction()); } } return(actions); }