public void setupPartyList() { peanut = new dog("Peanut", "Bichon"); fifi = new dog("Fifi", "Poodle"); clarence = new dog("Clarence", "German Sheppard"); giselle = new dog("giselle", "borker colllie"); lulu = new dog("lulu", "shitzu"); roy = new dog("Roy", "Beagle"); peanut.prev_dog = null; peanut.next_dog = fifi; fifi.prev_dog = peanut; fifi.next_dog = clarence; clarence.prev_dog = fifi; clarence.next_dog = giselle; giselle.prev_dog = clarence; giselle.next_dog = lulu; lulu.prev_dog = giselle; lulu.next_dog = roy; roy.prev_dog = lulu; roy.next_dog = null; head = peanut; tail = roy; }
public dog(string name, string breed, dog next_dog, dog previous_dog) { dog_name = name; dog_breed = breed; next_dog = next; previous_dog = previous; }
public string printPartyList_reverse() { string inviteList = "*--"; temporary = tail; inviteList += temporary.dog_name + " * --- * "; while (temporary.prev_dog != null) { // Console.WriteLine(temporary.next_dog.dog_name); temporary = temporary.prev_dog; inviteList += temporary.dog_name + " * --- * "; } return(inviteList); }
public void invite() { peanut = new dog("peanut", "Bichon"); fifi = new dog("fifi", "Poodle"); clarence = new dog("clarence", "German Sheppard"); roy = new dog("roy", "Beagle"); \ peanut.previous_dog = null; peanut.next_dog = fifi; fifi.previous_dog = peanut; fifi.next_dog = clarence; clarence.previous_dog = fifi; clarence.next_dog = roy; roy.previous_dog = clarence; roy.next_dog = null; }