예제 #1
0
        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;
        }
예제 #2
0
 public dog(string name, string breed, dog next_dog, dog previous_dog)
 {
     dog_name     = name;
     dog_breed    = breed;
     next_dog     = next;
     previous_dog = previous;
 }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }