|
@@ -0,0 +1,38 @@
|
|
|
|
+package ui.controller;
|
|
|
|
+
|
|
|
|
+public class Transformer extends WireNode {
|
|
|
|
+
|
|
|
|
+ /* Ratio of the transformer */
|
|
|
|
+ float transformRatio;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Constructor Set type of object (Transformer), its transform ratio and the
|
|
|
|
+ * default name ("Transformer");
|
|
|
|
+ */
|
|
|
|
+ public Transformer() {
|
|
|
|
+ super.setObjName("Transformer");
|
|
|
|
+ setTransformRatio(100);
|
|
|
|
+ super.name = super.getObjName();
|
|
|
|
+ System.out.println("You create a " + super.objName + " with ID " + super.ID);
|
|
|
|
+ System.out.println("It's actual name is: " + super.name);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set transform ratio
|
|
|
|
+ *
|
|
|
|
+ * @param ratio
|
|
|
|
+ * desired ratio
|
|
|
|
+ */
|
|
|
|
+ public void setTransformRatio(float ratio) {
|
|
|
|
+ this.transformRatio = ratio;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Output the actual ratio of the transformer
|
|
|
|
+ *
|
|
|
|
+ * @return actual ratio of the transformer
|
|
|
|
+ */
|
|
|
|
+ public float getTransformRatio() {
|
|
|
|
+ return this.transformRatio;
|
|
|
|
+ }
|
|
|
|
+}
|