mine work

This commit is contained in:
2024-04-23 18:50:00 -05:00
parent 9d59bde22e
commit 54c0b3d7ce
3 changed files with 16 additions and 2 deletions
+14
View File
@@ -66,6 +66,8 @@ public class Mine extends AbstractGameObject {
public static ArrayList<Mine> ChinaMines = new ArrayList<>();
public static ArrayList<Mine> EuroMines = new ArrayList<>();
public static ArrayList<Mine> AmericaMines = new ArrayList<>();
public boolean wasOpened = false;
/**
* ResultSet Constructor
*/
@@ -349,6 +351,16 @@ public class Mine extends AbstractGameObject {
} catch (Exception e) {
e.printStackTrace();
}
for(Mine mine : Mine.getMines()){
int minute = 0;
if (mine.firstThirty == false)
minute = 30;
LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0);
LocalDateTime closeTime = openTime.plusMinutes(30);
if(LocalDateTime.now().isAfter(closeTime))
mine.wasOpened = true;
}
}
/*
@@ -585,6 +597,8 @@ public class Mine extends AbstractGameObject {
if(isAc) {
ZergMechanicThread.startZergThreadMine(this);
}
this.wasOpened = true;
}
public boolean validForMine(Resource r) {