123456789101112131415161718192021222324252627282930313233 |
- package classes;
- public class HolonSwitch extends CpsObject {
- /*
- * True, if this wire is working (capable of carrying electricity), else
- * false
- */
- boolean isWorking;
- public HolonSwitch(String ObjName) {
- super(ObjName);
- isWorking = false;
- }
- public HolonSwitch(String ObjName, String obj) {
- super(ObjName);
- super.name = obj;
- isWorking = false;
- }
- public HolonSwitch(CpsObject obj) {
- super(obj);
- this.isWorking = ((HolonSwitch)obj).getStates();
- }
- public void switchState() {
- this.isWorking = !isWorking;
- }
- public boolean getStates() {
- return this.isWorking;
- }
- }
|