Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public int ComputeRemainingStockpileSpace()
 {
     return(Stockpiles.Sum(pile => pile.Resources.MaxResources - pile.Resources.CurrentResourceCount));
 }
Exemple #4
0
 public int ComputeTotalStockpileSpace()
 {
     return(Stockpiles.Sum(pile => pile.Resources.MaxResources));
 }
Exemple #5
0
 public decimal ComputeTotalTreasurySpace()
 {
     return(Stockpiles.Sum(pile => pile.Voxels.Count * Treasury.MoneyPerPile));
 }