public bool CanbeAdded(Rings ring) { if (GettopRingWithoutRemoving().Size > ring.Size || ring.Size == -1) { return(true); } else { return(false); } }
public Rings GettopRingWithoutRemoving() { Rings tempring = new Rings(-1); if (holdingRings.Count == 0) { return(tempring); } else { return(holdingRings.Peek()); } }
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(); }
public void addRing(Rings ring) { holdingRings.Push(ring); }