上传备份

master
王兵 1 week ago
parent 73f7a894c9
commit 04961abb42

@ -444,7 +444,6 @@ public abstract class JMacro {
}, timeout, TimeUnit.SECONDS);
}
/**
* ,,null
* <p>
@ -501,6 +500,26 @@ public abstract class JMacro {
return result;
}
/**
*
* <p>
*
*
* @param legends
* @param minSimilar
* @param seconds
* @return
*/
public Region waitAndFindAny(String[] legends, double minSimilar, long seconds) {
Region[] result = waitAndFindLegends(legends, minSimilar, seconds);
for (Region viewRect : result) {
if (viewRect != null) {
return viewRect;
}
}
return null;
}
/**
*
*
@ -528,17 +547,6 @@ public abstract class JMacro {
return Legend.inflate(legend);
}
/**
*
*
* @return
*/
public Location of(int x, int y) {
int ox = getWorkRegion().getX();
int oy = getWorkRegion().getY();
return new Location(x + ox, y + oy);
}
/**
*
*

@ -69,7 +69,7 @@ public class Legend {
}
List<File> files = FileUtil.loopFiles(defaultBase, pathname -> pathname.getName().startsWith(name));
if (files.size() == 0) {
if (files.isEmpty()) {
Logger.info(defaultBase.getAbsolutePath() + " not found the legend of " + name);
throw new RuntimeException(defaultBase.getAbsolutePath() + " not found the legend of " + name);
}

@ -64,6 +64,8 @@ public class DateUtil extends cn.hutool.core.date.DateUtil {
* @return
*/
public static boolean isTimeAfter(String baseTime, String time) {
checkTimeFormat(baseTime);
checkTimeFormat(time);
return baseTime.compareTo(time) < 0;
}
@ -96,6 +98,21 @@ public class DateUtil extends cn.hutool.core.date.DateUtil {
* @return
*/
public static boolean isTimeBefore(String baseTime, String time) {
checkTimeFormat(baseTime);
checkTimeFormat(time);
return baseTime.compareTo(time) > 0;
}
/**
* HH:mm:ss
*
* @param times
*/
private static void checkTimeFormat(String... times) {
for (String time : times) {
if (!time.matches("\\d{2}:\\d{2}:\\d{2}")) {
throw new IllegalArgumentException(time + " > 时间格式必须为 HH:mm:ss");
}
}
}
}
Loading…
Cancel
Save

Powered by TurnKey Linux.