public ResourceCollection(ResourceCollection rc)
 {
     resources = new int[Enum.GetValues(typeof(ResourceType)).Length - 1];
     AddResources(rc);
 }
 public bool HasEnough(ResourceCollection rc) => resources.Where((resource, i) => resource < rc.resources[i]).Any() == false;
示例#3
0
 public void SpendResources(ResourceCollection collection)
 {
     storedResources.TrySpendResource(collection);
     OnResourceChange?.Invoke();
 }