public IEnumerable <GameRuleFile> GetGameRules() { string rulesPath = Path.Combine(rootDir, "Data", "scar", "winconditions"); var loader = new GameRuleLoader(); return(GetFiles(rulesPath, "*_local.lua", SearchOption.TopDirectoryOnly) .Select(file => loader.Load(file)) .Where(rule => rule != null) as IEnumerable <GameRuleFile>); }
public IEnumerable <GameRuleFile> GetGameRules() { var gameRuleLoader = new GameRuleLoader(); foreach (var wincondition in sgaFileReader.GetWinConditions()) { GameRuleFile?gameRule = gameRuleLoader.Load(new MemoryStream(wincondition.Data)); if (gameRule != null) { yield return(gameRule); } } }