public bool CheckResources(ResourceStack st) { return(CheckResources(new ResourceTotality().Add(st))); }
/// <summary> /// Adds stack to player resources, considering limits. /// </summary> /// <param name="stack">Stack to add to player resources</param> /// <returns>Not used resources, that does not fit to limits</returns> public ResourceStack AddResource(ResourceStack stack) { int c = GetResource(stack.Type); return(new ResourceStack(stack.Type, stack.Count - (SetResource(stack.Type, c + stack.Count) - c))); }
public ResourceTotality Add(ResourceStack s) { this[s.Type] += s.Count; return(this); }