// check if a given state is on this state's active path
 public bool StateOnPath(GameState state)
 {
     if (this == state)
     {
         return(true);
     }
     if (ParentState == null)
     {
         return(false);
     }
     return(ParentState.StateOnPath(state));
 }