Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+38 -39
View File
@@ -7,7 +7,7 @@
// www.magicbane.com
package engine.jobs;
package engine.jobs;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager;
@@ -18,48 +18,47 @@ import engine.objects.PlayerCharacter;
public class DatabaseUpdateJob extends AbstractScheduleJob {
private final AbstractGameObject ago;
private final String type;
private final AbstractGameObject ago;
private final String type;
public DatabaseUpdateJob(AbstractGameObject ago, String type) {
super();
this.ago = ago;
this.type = type;
}
public DatabaseUpdateJob(AbstractGameObject ago, String type) {
super();
this.ago = ago;
this.type = type;
}
@Override
protected void doJob() {
if (this.ago == null)
return;
ago.removeDatabaseJob(this.type, false);
if (ago.getObjectType().equals(GameObjectType.PlayerCharacter)) {
PlayerCharacter pc = (PlayerCharacter) ago;
switch (this.type) {
case "Skills":
pc.updateSkillsAndPowersToDatabase();
break;
case "Stats":
DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_STATS(pc);
break;
case "EXP":
DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_EXPERIENCE(pc);
break;
}
@Override
protected void doJob() {
if (this.ago == null)
return;
ago.removeDatabaseJob(this.type, false);
}
else if (ago instanceof Building) {
Building b = (Building) ago;
if (this.type.equals("health"))
DbManager.BuildingQueries.UPDATE_BUILDING_HEALTH(b.getObjectUUID(), (int)(b.getHealth()));
}
if (ago.getObjectType().equals(GameObjectType.PlayerCharacter)) {
}
PlayerCharacter pc = (PlayerCharacter) ago;
@Override
protected void _cancelJob() {
}
switch (this.type) {
case "Skills":
pc.updateSkillsAndPowersToDatabase();
break;
case "Stats":
DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_STATS(pc);
break;
case "EXP":
DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_EXPERIENCE(pc);
break;
}
} else if (ago instanceof Building) {
Building b = (Building) ago;
if (this.type.equals("health"))
DbManager.BuildingQueries.UPDATE_BUILDING_HEALTH(b.getObjectUUID(), (int) (b.getHealth()));
}
}
@Override
protected void _cancelJob() {
}
}