public bool HasResources(IEnumerable <ResourceAmount> resources) { foreach (ResourceAmount resource in resources) { int count = Stockpiles.Sum(stock => stock.Resources.GetResourceCount(resource.ResourceType)); if (count < resources.Where(r => r.ResourceType == resource.ResourceType).Sum(r => r.NumResources)) { return(false); } } return(true); }
public bool HasResources(IEnumerable <Quantitiy <Resource.ResourceTags> > resources, bool allowHeterogenous = false) { foreach (Quantitiy <Resource.ResourceTags> resource in resources) { int count = Stockpiles.Sum(stock => stock.Resources.GetResourceCount(resource.ResourceType, allowHeterogenous)); if (count < resource.NumResources) { return(false); } } return(true); }
public int ComputeRemainingStockpileSpace() { return(Stockpiles.Sum(pile => pile.Resources.MaxResources - pile.Resources.CurrentResourceCount)); }
public int ComputeTotalStockpileSpace() { return(Stockpiles.Sum(pile => pile.Resources.MaxResources)); }
public decimal ComputeTotalTreasurySpace() { return(Stockpiles.Sum(pile => pile.Voxels.Count * Treasury.MoneyPerPile)); }