浏览代码

Update ResourceSet.h

Rename income to availableFunds
Xilmi 1 年之前
父节点
当前提交
20cfe712c9
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lib/ResourceSet.h

+ 4 - 4
lib/ResourceSet.h

@@ -148,19 +148,19 @@ public:
 		return ret;
 	}
 
-	//Returns how many items of "this" we can afford with provided income
-	int maxPurchasableCount(const ResourceSet& income) {
+	//Returns how many items of "this" we can afford with provided funds
+	int maxPurchasableCount(const ResourceSet& availableFunds) {
 		int ret = 0; // Initialize to 0 because we want the maximum number of accumulations
 
 		for (size_t i = 0; i < container.size(); ++i) {
 			if (container.at(i) > 0) { // We only care about fulfilling positive needs
-				if (income[i] == 0) {
+				if (availableFunds[i] == 0) {
 					// If income is 0 and we need a positive amount, it's impossible to fulfill
 					return INT_MAX;
 				}
 				else {
 					// Calculate the number of times we need to accumulate income to fulfill the need
-					int ceiledResult = vstd::divideAndCeil(container.at(i), income[i]);
+					int ceiledResult = vstd::divideAndCeil(container.at(i), availableFunds[i]);
 					ret = std::max(ret, ceiledResult);
 				}
 			}