Example #1
0
        public static TermObject FromString(string value)
        {
            var term = new TermObject();

            if (value.StartsWith("none", StringComparison.InvariantCulture))
            {
                term.Instance = new NoneTerm {
                    StringValue = value
                };
            }
            else if (value.StartsWith("flag", StringComparison.InvariantCulture) || value.StartsWith("!flag", StringComparison.InvariantCulture))
            {
                term.Instance = new FlagTerm {
                    StringValue = value
                };
            }
            else if (value.StartsWith("variable", StringComparison.InvariantCulture))
            {
                term.Instance = new VariableTerm {
                    StringValue = value
                };
            }
            else if (value.StartsWith("havechip", StringComparison.InvariantCulture))
            {
                term.Instance = new ChipTerm {
                    StringValue = value
                };
            }
            else
            {
                term.Instance = new NoneTerm {
                    StringValue = value
                };
            }

            return(term);
        }
Example #2
0
 protected override void SetStringValue(string value) => this.Instance = TermObject.FromString(value).Instance;