Exemple #1
0
 public void add(Object newObject1, Object newObject2, Object newObject3, Object newObject4, Object newObject5)
 {
     ListElement newElement1 = new ListElement(newObject1);
     ListElement newElement2 = new ListElement(newObject2);
     ListElement newElement3 = new ListElement(newObject3);
     ListElement newElement4 = new ListElement(newObject4);
     ListElement newElement5 = new ListElement(newObject5);
     newElement1.next = head.next;
     newElement2.next = newElement1;
     newElement3.next = newElement2;
     newElement4.next = newElement3;
     newElement5.next = newElement4;
     head.next = newElement5;
     number += 5; //erhöhe Listenanzahl
 }
Exemple #2
0
 public void add(Object newObject1, Object newObject2, Object newObject3)
 {
     ListElement newElement1 = new ListElement(newObject1);
     ListElement newElement2 = new ListElement(newObject2);
     ListElement newElement3 = new ListElement(newObject3);
     newElement1.next = head.next;
     newElement2.next = newElement1;
     newElement3.next = newElement2;
     head.next = newElement3;
     number += 3; //erhöhe Listenanzahl
 }
Exemple #3
0
 public void add(Object newObject1)
 {
     ListElement newElement = new ListElement(newObject1);
     newElement.next = head.next;
     head.next = newElement;
     number++; //erhöhe Listenanzahl
 }
Exemple #4
0
 public Listing(int Type)
 {
     Card car;
     head = new ListElement(null);
     if (Type == 1) //neuer Kartenstapel
     {
         int i = 2;
         do
         {
             for (int j = 2; j <= 13; j++)
             {
                 car = new Card(i, j);
                 this.add(car);
             }
             switch(i)
             {
                 case 2:
                     i=3; break;
                 case 3:
                     i=5; break;
                 case 5:
                     i=7; break;
                 default:
                     i=0; break;
             }
         }while(i!=0);
         this.add(new Card(0, 0));//Joker
         this.add(new Card(0, 0));
     }
 }
Exemple #5
0
 public Listing()
 {
     head = new ListElement(null);
 }
Exemple #6
0
        public bool rm(Object toRemove)
        {
            if (next.data == toRemove) //falls der Inhalt des nächsten Objekt das löschende ist
            {
                next = next.next; //überspringe dieses Objekt
                return true;
            }

            if (next.next == null) //falls das Ende der Liste, dann beende
            {
               return false;
            }
            return next.rm(toRemove); //Rufe das nächste Objekt auf
        }