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); } } }
private void LoadTokenizerRuleString(string rulesString) { rulesString = rulesString.Replace(@"\\", @"\"); _battleTokenizer.TokenDefinitions = RulesParser.ParseFromString(rulesString).ToList(); }