public ActionButtonNode GetOptionTreeRoot(Actor actor) { ActionButtonNode root = new ActionButtonNode(); root.label = ValueLabel(); DecorateOption(root); root.choice = this; PopulatePathChildren(root, ActionOptions.ToList(), actor); if (UseLimitReachedUntilLongRest) { root.disabled = true; root.disabledReason = "You have to wait until a long rest to use this again."; } return(root); }
public bool CanFillOptions(Actor actor) { ActionButtonNode root = new ActionButtonNode(); root.label = ValueLabel(); bool canFill = false; CheckInOptionLeafAction checkin = (leaf) => { Debug.Log("found a leaf!: " + leaf.label); //any leaf will do... canFill = true; }; DeadEndOptionLeafAction deadend = (leaf, reason) => { Debug.Log("Dead end: " + leaf.label); Debug.Log("reason: " + reason); }; CheckForLeaves(root, ActionOptions.ToList(), actor, checkin, deadend); return(canFill); }