public override bool Equals(object obj) { Pancake pan = obj as Pancake; if (pan == null) { return(false); } else { return(sideUp.Equals(pan.sideUp)); } }
public static void stackPancakes(String pancakeStack) { Stack temp = new Stack(); Pancake pan; var pancakes = pancakeStack.ToCharArray(); foreach (char p in pancakes) { temp.Push(p); } while (temp.Count > 0) { pan = new Pancake((char)temp.Pop()); st.Push(pan); } }