HolonSwitch.java 463 B

1234567891011121314151617181920212223242526
  1. package classes;
  2. public class HolonSwitch extends CpsObject {
  3. /*True, if this wire is working (capable of carrying electricity), else false*/
  4. boolean isWorking;
  5. public HolonSwitch(String ObjName) {
  6. super(ObjName);
  7. isWorking = false;
  8. }
  9. public HolonSwitch(HolonObject obj) {
  10. super(obj.objName);
  11. isWorking = false;
  12. }
  13. public void switchState() {
  14. this.isWorking = !isWorking;
  15. }
  16. public boolean getStates() {
  17. return this.isWorking;
  18. }
  19. }