public bool PopTo(Claim claim) { Stack <ClaimLoc> storeStack = new Stack <ClaimLoc>(_prevClaims); while (_prevClaims.Count > 0) { ClaimLoc top = storeStack.Pop(); if (top.Claim == claim) { return(true); } } _prevClaims = storeStack; return(false); }
public bool Revert(Claim claim) { Stack <ClaimLoc> storeStack = new Stack <ClaimLoc>(_prevClaims); while (_prevClaims.Count > 0) { ClaimLoc top = storeStack.Pop(); if (top.Claim == claim) { _offset = top.Location; return(true); } } _prevClaims = storeStack; return(false); }