public GameDataRepository() { _gameConfigCache = CallContext <GameConfigCache> .GetData("GameConfigCache"); Factions = new FactionsCollection(); Units = new UnitRecords(); Stacks = new StacksCollection(); Settlements = new SettlementsCollection(); }
public UnitRecords GetUnitsByFactionId(int factionId) { var stacks = Stacks.GetByFactionId(factionId); var unitRecords = new UnitRecords(); foreach (var stack in stacks) { var unitsForStack = GetUnitsByStackId(stack.Id); foreach (var unit in unitsForStack) { unitRecords.Add(unit); } } return(unitRecords); }