|
@@ -1,67 +1,78 @@
|
|
|
package ui.controller;
|
|
|
|
|
|
-abstract class cpsObj {
|
|
|
- /*Type of the Object*/
|
|
|
+abstract class CPSObj {
|
|
|
+ /* Type of the Object */
|
|
|
String objName;
|
|
|
- /*Name given by the user*/
|
|
|
+ /* Name given by the user */
|
|
|
String name;
|
|
|
- /*ID of the Obj.*/
|
|
|
+ /* ID of the Obj. */
|
|
|
int ID;
|
|
|
- /*Path of the image for the Obj.*/
|
|
|
+ /* Path of the image for the Obj. */
|
|
|
String image;
|
|
|
- /*Array of neighbors*/
|
|
|
- cpsObj[] connectedTo;
|
|
|
- /*Position with a X and Y value*/
|
|
|
+ /* Array of neighbors */
|
|
|
+ CPSObj[] connectedTo;
|
|
|
+ /* Position with a X and Y value */
|
|
|
int xCoord;
|
|
|
int yCoord;
|
|
|
-
|
|
|
- /*Obj type*/
|
|
|
+ public CPSObj() {
|
|
|
+ ID = IdCounter.nextId();
|
|
|
+ }
|
|
|
+ /* Obj type */
|
|
|
public String getObjName() {
|
|
|
return objName;
|
|
|
}
|
|
|
+
|
|
|
public void setObjName(String objName) {
|
|
|
this.objName = objName;
|
|
|
}
|
|
|
- /*User defined Name*/
|
|
|
+
|
|
|
+ /* User defined Name */
|
|
|
public String getName() {
|
|
|
return name;
|
|
|
}
|
|
|
+
|
|
|
public void setName(String name) {
|
|
|
this.name = name;
|
|
|
}
|
|
|
- /*Unique ID number*/
|
|
|
+
|
|
|
+ /* Unique ID number */
|
|
|
public int getID() {
|
|
|
return ID;
|
|
|
}
|
|
|
- public void setID(int iD) {
|
|
|
- ID = iD;
|
|
|
- }
|
|
|
- /*Image path*/
|
|
|
+
|
|
|
+ /* Image path */
|
|
|
public String getImage() {
|
|
|
return image;
|
|
|
}
|
|
|
+
|
|
|
public void setImage(String image) {
|
|
|
this.image = image;
|
|
|
}
|
|
|
- /*Neighbors array*/
|
|
|
- public cpsObj[] getConnectedTo() {
|
|
|
+
|
|
|
+ /* Neighbors array */
|
|
|
+ public CPSObj[] getConnectedTo() {
|
|
|
return connectedTo;
|
|
|
}
|
|
|
- public void setConnectedTo(cpsObj[] connectedTo) {
|
|
|
+
|
|
|
+ public void setConnectedTo(CPSObj[] connectedTo) {
|
|
|
this.connectedTo = connectedTo;
|
|
|
}
|
|
|
- /*Position (x and Y)*/
|
|
|
+
|
|
|
+ /* Position (x and Y) */
|
|
|
public int getxCoord() {
|
|
|
return xCoord;
|
|
|
}
|
|
|
+
|
|
|
public void setxCoord(int xCoord) {
|
|
|
this.xCoord = xCoord;
|
|
|
}
|
|
|
+
|
|
|
public int getyCoord() {
|
|
|
return yCoord;
|
|
|
}
|
|
|
+
|
|
|
public void setyCoord(int yCoord) {
|
|
|
this.yCoord = yCoord;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|