Esempio n. 1
0
        public ParsedGoal Parse(string goal)
        {
            var elements = goal.Split(' ');
            var parsedElements = new List<ParsedGoalElement>();

            for (var i = 0; i < elements.Length; i++) {
                var parsedGoalElement = new ParsedGoalElement(elements[i]);

                if (i > 0) {
                    parsedGoalElement.SetPrevious(parsedElements[i - 1]);
                }

                parsedElements.Add(parsedGoalElement);
            }

            var parsedGoalElements = new ParsedGoalElements(parsedElements);

            return new ParsedGoal {
                Deadline = parsedGoalElements.GetDeadline(),
                Direction = parsedGoalElements.GetDirection(),
                Quantity = parsedGoalElements.GetQuantity()
            };
        }
Esempio n. 2
0
 private void SetNextElement(ParsedGoalElement nextElement)
 {
     this.NextElement = nextElement;
 }
Esempio n. 3
0
 public void SetPrevious(ParsedGoalElement previousElement)
 {
     this.previousElement = previousElement;
     this.previousElement.SetNextElement(this);
 }