Example #1
0
        internal State(CheckPoint checkPoint, Name name, Percent percent)
        {
            CheckPoint = checkPoint ?? throw new ArgumentNullException(nameof(checkPoint));
            Name       = name ?? throw new ArgumentNullException(nameof(name));
            Percent    = percent ?? throw new ArgumentNullException(nameof(name));

            _transitions = new List <State>();
        }
Example #2
0
        public bool RevertLastState(CheckPoint checkPoint)
        {
            var record = Records.LastOrDefault(r => r.State.CheckPoint == checkPoint);

            if (record != null)
            {
                return(_records.Remove(record));
            }
            return(false);
        }