public StoneStack Copy() { var ret = new StoneStack(); foreach (var item in this) { ret.Push(item); } return(ret); }
public StoneStack SplitStack(int take) { var tempStack = new StoneStack(); for (int i = 0; i < take; i++) { tempStack.Push(Pop()); } var newStack = new StoneStack(); for (int i = 0; i < take; i++) { newStack.Push(tempStack.Pop()); } return(newStack); }