public static void runUpDownQuerries(ref jumpPrime myObj) { while (myObj.getActiveStatus()) { Console.WriteLine($"Up: {myObj.up()}"); Console.WriteLine($"Down: {myObj.down()}"); } }
//may out many zeros if object becomes inactive private static void iterate_down(ref jumpPrime obj, int num) { Console.WriteLine("We are querying the down call: "); for (int i = 0; i < num; i++) { Console.Write(i + ". " + obj.down() + " "); } Console.WriteLine(); }
//once it becomes inactive, it should revive private static void iterate_down_with_revive(ref jumpPrime obj, int num) { Console.WriteLine("We are querying the down call: "); for (int i = 0; i < num; i++) { if (obj.getActive()) { Console.Write(i + ". " + obj.down() + " "); } else { Console.Write("We exceeded the querying limit... Must Revive "); obj.revive(); break; } } Console.WriteLine(); }