Пример #1
0
        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);
        }
Пример #2
0
        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);
        }