|
@@ -1,6 +1,6 @@
|
|
|
package ui.controller;
|
|
|
|
|
|
-abstract class CPSObj {
|
|
|
+abstract class CpsObject {
|
|
|
/* Type of the Object */
|
|
|
String objName;
|
|
|
/* Name given by the user */
|
|
@@ -10,13 +10,21 @@ abstract class CPSObj {
|
|
|
/* Path of the image for the Obj. */
|
|
|
String image;
|
|
|
/* Array of neighbors */
|
|
|
- CPSObj[] connectedTo;
|
|
|
+ CpsObject[] connectedTo;
|
|
|
/* Position with a X and Y value */
|
|
|
int xCoord;
|
|
|
int yCoord;
|
|
|
- public CPSObj() {
|
|
|
+ /*Energy input and output of each object in the grid*/
|
|
|
+ float energyIn;
|
|
|
+ float energyOut;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Constructor for an CpsObejct with an unique ID
|
|
|
+ */
|
|
|
+ public CpsObject() {
|
|
|
ID = IdCounter.nextId();
|
|
|
}
|
|
|
+
|
|
|
/* Obj type */
|
|
|
public String getObjName() {
|
|
|
return objName;
|
|
@@ -50,11 +58,11 @@ abstract class CPSObj {
|
|
|
}
|
|
|
|
|
|
/* Neighbors array */
|
|
|
- public CPSObj[] getConnectedTo() {
|
|
|
+ public CpsObject[] getConnectedTo() {
|
|
|
return connectedTo;
|
|
|
}
|
|
|
|
|
|
- public void setConnectedTo(CPSObj[] connectedTo) {
|
|
|
+ public void setConnectedTo(CpsObject[] connectedTo) {
|
|
|
this.connectedTo = connectedTo;
|
|
|
}
|
|
|
|
|
@@ -74,5 +82,22 @@ abstract class CPSObj {
|
|
|
public void setyCoord(int yCoord) {
|
|
|
this.yCoord = yCoord;
|
|
|
}
|
|
|
+
|
|
|
+ /*Getter and Setters for the energy input and output*/
|
|
|
+ public float getEnergyIn() {
|
|
|
+ return energyIn;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setEnergyIn(float energyIn) {
|
|
|
+ this.energyIn = energyIn;
|
|
|
+ }
|
|
|
+
|
|
|
+ public float getEnergyOut() {
|
|
|
+ return energyOut;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setEnergyOut(float energyOut) {
|
|
|
+ this.energyOut = energyOut;
|
|
|
+ }
|
|
|
|
|
|
}
|