Beispiel #1
0
 public bool CanbeAdded(Rings ring)
 {
     if (GettopRingWithoutRemoving().Size > ring.Size || ring.Size == -1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #2
0
        public Rings GettopRingWithoutRemoving()
        {
            Rings tempring = new Rings(-1);

            if (holdingRings.Count == 0)
            {
                return(tempring);
            }
            else
            {
                return(holdingRings.Peek());
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Peck left   = new Peck("Left");
            Peck middel = new Peck("Middel");
            Peck right  = new Peck("Right");

            Console.WriteLine("Enter Amount of rings");
            var amountofRings = int.Parse(Console.ReadLine());

            int count = amountofRings;

            while (count != 0)
            {
                int   size = amountofRings * 100;
                Rings ring = new Rings(size);
                left.addRing(ring);
                size = size - 10;
                count--;
            }

            Move(amountofRings, left, right, middel);
            Console.WriteLine(Singletonmfcounting.StaticInstance.count);
            Console.ReadKey();
        }
Beispiel #4
0
 public void addRing(Rings ring)
 {
     holdingRings.Push(ring);
 }