Static objects now use doids

This commit is contained in:
Treeku
2014-04-29 08:36:44 +01:00
parent 29e78e1d0d
commit 3368682443
5 changed files with 61 additions and 29 deletions
@@ -61,15 +61,15 @@ public class BuildingObject extends TangibleObject implements IPersistent {
private short maximumStorageCapacity=0;
private Vector<Long> entryList = new Vector<Long>(); // Preferably the OIDs should be stored, because of name changes
private Vector<Long> banList = new Vector<Long>();
public BuildingObject() {
super();
public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
super(objectID, planet, Template, position, orientation);
messageBuilder = new BuildingMessageBuilder(this);
this.setConditionDamage(100);
}
public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
super(objectID, planet, Template, position, orientation);
public BuildingObject() {
super();
messageBuilder = new BuildingMessageBuilder(this);
this.setConditionDamage(100);
}
@@ -89,6 +89,18 @@ public class BuildingObject extends TangibleObject implements IPersistent {
}
public int getCellNumberByObjectId(long objectId) {
Vector<CellObject> cells = getCells();
for (CellObject cell : cells) {
if (cell.getObjectID() == objectId) {
return cell.getCellNumber();
}
}
return 0;
}
public float getMaintenanceAmount() {
return maintenanceAmount;
}