use of mcjty.rftoolsdim.dimensions.dimlets.DimletKey in project RFToolsDimensions by McJty.
the class DimensionDescriptor method calculateMaintenanceRfCost.
// Calculate the maintenance cost of a dimension without bonus dimlets.
private int calculateMaintenanceRfCost(List<Pair<DimletKey, List<DimletKey>>> dimlets) {
int rf = DimletCosts.baseDimensionMaintenanceCost;
for (Pair<DimletKey, List<DimletKey>> dimletWithModifier : dimlets) {
DimletKey key = dimletWithModifier.getLeft();
DimletType type = key.getType();
List<DimletKey> list = dimletWithModifier.getRight();
if (list != null) {
for (DimletKey modifier : list) {
float mult = type.dimletType.getModifierMaintainCostFactor(modifier.getType(), key);
rf += (int) (getMaintenanceCost(modifier.getType(), modifier) * mult);
}
}
int c = getMaintenanceCost(type, key);
if (c > 0) {
rf += c;
}
}
return rf;
}
Aggregations