|
@@ -173,7 +173,7 @@ public class Resources {
|
|
|
}
|
|
|
|
|
|
public static Resource addTo(Resource lhs, Resource rhs) {
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = rhs.getResourceInformation(i);
|
|
@@ -197,7 +197,7 @@ public class Resources {
|
|
|
}
|
|
|
|
|
|
public static Resource subtractFrom(Resource lhs, Resource rhs) {
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = rhs.getResourceInformation(i);
|
|
@@ -243,7 +243,7 @@ public class Resources {
|
|
|
}
|
|
|
|
|
|
public static Resource multiplyTo(Resource lhs, double by) {
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation lhsValue = lhs.getResourceInformation(i);
|
|
@@ -266,7 +266,7 @@ public class Resources {
|
|
|
*/
|
|
|
public static Resource multiplyAndAddTo(
|
|
|
Resource lhs, Resource rhs, double by) {
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = rhs.getResourceInformation(i);
|
|
@@ -299,7 +299,7 @@ public class Resources {
|
|
|
|
|
|
public static Resource multiplyAndRoundDown(Resource lhs, double by) {
|
|
|
Resource out = clone(lhs);
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation lhsValue = lhs.getResourceInformation(i);
|
|
@@ -408,7 +408,7 @@ public class Resources {
|
|
|
}
|
|
|
|
|
|
public static boolean fitsIn(Resource smaller, Resource bigger) {
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = bigger.getResourceInformation(i);
|
|
@@ -436,7 +436,7 @@ public class Resources {
|
|
|
|
|
|
public static Resource componentwiseMin(Resource lhs, Resource rhs) {
|
|
|
Resource ret = createResource(0);
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = rhs.getResourceInformation(i);
|
|
@@ -460,7 +460,7 @@ public class Resources {
|
|
|
|
|
|
public static Resource componentwiseMax(Resource lhs, Resource rhs) {
|
|
|
Resource ret = createResource(0);
|
|
|
- int maxLength = ResourceUtils.getResourceTypesArray().length;
|
|
|
+ int maxLength = ResourceUtils.getNumberOfKnownResourceTypes();
|
|
|
for (int i = 0; i < maxLength; i++) {
|
|
|
try {
|
|
|
ResourceInformation rhsValue = rhs.getResourceInformation(i);
|