forked from MagicBane/Server
New collection created in handled and loaded from db
This commit is contained in:
@@ -14,72 +14,45 @@ import engine.gameManager.DbManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class Condemned {
|
||||
|
||||
public static final int INDIVIDUAL = 2;
|
||||
public static final int GUILD = 4;
|
||||
public static final int NATION = 5;
|
||||
private int ID;
|
||||
private int playerUID;
|
||||
private int parent;
|
||||
private int guildUID;
|
||||
private int friendType;
|
||||
private boolean active;
|
||||
|
||||
public int playerUID;
|
||||
public int buildingUUID;
|
||||
public int guildUID;
|
||||
public int friendType;
|
||||
public boolean active;
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public Condemned(ResultSet rs) throws SQLException {
|
||||
this.playerUID = rs.getInt("playerUID");
|
||||
this.parent = rs.getInt("buildingUID");
|
||||
this.buildingUUID = rs.getInt("buildingUID");
|
||||
this.guildUID = rs.getInt("guildUID");
|
||||
this.friendType = rs.getInt("friendType");
|
||||
this.active = rs.getBoolean("active");
|
||||
}
|
||||
|
||||
|
||||
public Condemned(int playerUID, int parent, int guildUID, int friendType) {
|
||||
public Condemned(int playerUID, int buildingUUID, int guildUID, int friendType) {
|
||||
super();
|
||||
this.playerUID = playerUID;
|
||||
this.parent = parent;
|
||||
this.buildingUUID = buildingUUID;
|
||||
this.guildUID = guildUID;
|
||||
this.friendType = friendType;
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
|
||||
public int getPlayerUID() {
|
||||
return playerUID;
|
||||
}
|
||||
|
||||
|
||||
public int getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
|
||||
public int getGuildUID() {
|
||||
return guildUID;
|
||||
}
|
||||
|
||||
|
||||
public int getFriendType() {
|
||||
return friendType;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
|
||||
public boolean setActive(boolean active) {
|
||||
|
||||
if (!DbManager.BuildingQueries.updateActiveCondemn(this, active))
|
||||
return false;
|
||||
|
||||
this.active = active;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user