You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tank/src/com/msb/strategy/CatWeightComparator.java

17 lines
395 B

package com.msb.strategy;
/**
* @Author bingor
* @Date 2022-10-06 17:56
* @Description: com.msb.strategy
* @Version: 1.0
*/
public class CatWeightComparator implements Comparator<Cat2> {
@Override
public int compare(Cat2 o1, Cat2 o2) {
if(o1.getWeight() < o2.getWeight()) return -1;
else if(o1.getWeight() > o2.getWeight()) return 1;
else return 0;
}
}