updated Robot classes

main
Philipp3107 2022-12-09 00:30:35 +01:00
parent c5c665a9f3
commit e43add6605
2 changed files with 2 additions and 59 deletions

View File

@ -1,6 +1,6 @@
package domain;
public class C3PO implements Robot{
public class C3PO extends RobotBasics {
private int id;
private String name;
@ -11,27 +11,5 @@ public class C3PO implements Robot{
this.name = name;
power = false;
}
@Override
public int getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public void triggerPowerSwitch() {
if(power = false){
power = true;
}else{
power = false;
}
}
@Override
public boolean isPowerOn() {
return power;
}
}

View File

@ -1,6 +1,6 @@
package domain;
public class R2D2 implements Robot{
public class R2D2 extends RobotBasics {
private int id;
private String name;
private boolean power;
@ -16,39 +16,4 @@ public class R2D2 implements Robot{
power = false;
}
/**
* @see domain.RobotControl
*/
@Override
public int getId() {
return id;
}
/**
* @see domain.RobotControl
*/
@Override
public String getName() {
return name;
}
/**
* @see domain.RobotControl
*/
@Override
public void triggerPowerSwitch() {
if(power == false){
power = true;
}else{
power = false;
}
}
/**
* @see domain.RobotControl
*/
@Override
public boolean isPowerOn() {
return power;
}
}