예제 #1
0
        /// <summary>
        /// Creates and returns a copy of this ResourceCount, with positive and negative values flipped.
        /// </summary>
        /// <returns></returns>
        public ResourceCount CloneNegative()
        {
            ResourceCount clone = Clone();

            foreach (RechargeableResourceEnum currentResource in Enum.GetValues(typeof(RechargeableResourceEnum)))
            {
                clone.ApplyAmount(currentResource, clone.GetAmount(currentResource) * -1);
            }

            return(clone);
        }
 /// <summary>
 /// Returns the current amount of the provided rechargeable resource.
 /// </summary>
 /// <param name="resource">Resource to get the amount of.</param>
 /// <returns></returns>
 public int GetCurrentAmount(RechargeableResourceEnum resource)
 {
     return(Resources.GetAmount(resource));
 }