Example #1
0
        static Room()
        {
            Option <StreamReader> readerResult = FileService.LoadFromResources("Assets.HeaderRules.txt");

            if (readerResult.HasValue)
            {
                using (var reader = readerResult.ValueOrFailure())
                {
                    string rulesString = reader.ReadToEnd();
                    IEnumerable <TokenDefinition> tokenDefs = RulesParser.ParseFromString(rulesString);
                    _headerTokenizer = new Tokenizer(tokenDefs);
                }
            }
        }
Example #2
0
 private void LoadTokenizerRuleString(string rulesString)
 {
     rulesString = rulesString.Replace(@"\\", @"\");
     _battleTokenizer.TokenDefinitions = RulesParser.ParseFromString(rulesString).ToList();
 }