public void run() { Mapple = new village(); Toronto = new village(); Ajax = new village(); Ajax.villagename = "Ajax"; Ajax.isAstrilde = true; Mapple.villagename = "Mapple"; Mapple.nextvillage = Toronto; Toronto.nextvillage = Ajax; Toronto.villagename = "Toronto"; Ajax.nextvillage = null; }
public void run() { village Toronto; Toronto = new village(); village a, b, c; Toronto.villagename = "Version A"; a = Toronto; Toronto = new village(); Toronto.villagename = "Version B"; b = Toronto; Toronto = new village(); Toronto.villagename = "Version C"; c = Toronto; Console.WriteLine(a.villagename); }
public void travel() { currentvillage = Toronto; while (true) { if (currentvillage.isAstrilde) { Console.WriteLine(" Astrilde is in: " + currentvillage.villagename); Console.ReadLine(); } else { currentvillage = currentvillage.nextvillage; } } }