/// <summary>
 /// Sets current value for the provided consumable resource to the current maximum.
 /// This is almost the same as refilling a rechargeable resource,
 /// except both types of energy are grouped together.
 /// </summary>
 /// <param name="model">A model that can be used to obtain data about the current game configuration.</param>
 /// <param name="resource">The resource to refill</param>
 public void ApplyRefillResource(SuperMetroidModel model, ConsumableResourceEnum resource)
 {
     // Don't bother with current resource count if resource tracking is disabled
     if (model.LogicalOptions.ResourceTrackingEnabled)
     {
         foreach (RechargeableResourceEnum rechargeableResource in resource.ToRechargeableResources())
         {
             ApplyRefillResource(model, rechargeableResource);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Returns the amount associated to this container for the provided consumable resource.
 /// This is almost the same as getting the current amount of a rechargeable resource,
 /// except both types of energy are grouped together.
 /// </summary>
 /// <param name="resource">Resource to get the amount of.</param>
 /// <returns></returns>
 public int GetAmount(ConsumableResourceEnum resource)
 {
     return(resource.ToRechargeableResources().Select(resource => GetAmount(resource)).Sum());
 }