//First build reaction chain public void AddReaction(Func<bool> react, Action action) { ReAction newReAction = new ReAction(); newReAction.react = react; newReAction.action = action; reActions.Add(newReAction); enabled = true; }
//First build reaction chain public void AddReaction(Func <bool> react, Action action) { ReAction newReAction = new ReAction(); newReAction.react = react; newReAction.action = action; reActions.Add(newReAction); enabled = true; }
void Next() { pointer = pointer + 1; if (pointer < reActions.Count) { currReaction = reActions[pointer]; } else { enabled = false; } }
public void Enable() { pointer = 0; currReaction = reActions[pointer]; enabled = true; }