first version of pattern without Tests
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package concreteextensions;
|
||||
|
||||
import abstractextensions.CommanderExtension;
|
||||
import units.CommanderUnit;
|
||||
|
||||
/**
|
||||
* Created by Srdjan on 27-Apr-17.
|
||||
*/
|
||||
public class Commander implements CommanderExtension {
|
||||
|
||||
private CommanderUnit unit;
|
||||
|
||||
public Commander(CommanderUnit commanderUnit) {
|
||||
this.unit = commanderUnit;
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package concreteextensions;
|
||||
|
||||
import abstractextensions.SergeantExtension;
|
||||
import units.SergeantUnit;
|
||||
|
||||
/**
|
||||
* Created by Srdjan on 27-Apr-17.
|
||||
*/
|
||||
public class Sergeant implements SergeantExtension {
|
||||
|
||||
private SergeantUnit unit;
|
||||
|
||||
public Sergeant(SergeantUnit sergeantUnit) {
|
||||
this.unit = sergeantUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sergeantReady() {
|
||||
System.out.println("[Sergeant] " + unit.getName() + " do command! ");
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package concreteextensions;
|
||||
|
||||
import abstractextensions.SoldierExtension;
|
||||
import units.SoldierUnit;
|
||||
|
||||
/**
|
||||
* Created by Srdjan on 26-Apr-17.
|
||||
*/
|
||||
public class Soldier implements SoldierExtension {
|
||||
|
||||
private SoldierUnit unit;
|
||||
|
||||
public Soldier(SoldierUnit soldierUnit) {
|
||||
this.unit = soldierUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void soldierReady() {
|
||||
System.out.println("[Solider] " + unit.getName() + " do command");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user