18 lines
335 B
D
18 lines
335 B
D
|
module strategy.app;
|
||
|
|
||
|
import strategy.duck;
|
||
|
import strategy.flybehavior;
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
Duck mallard = new MallardDuck;
|
||
|
mallard.performQuack();
|
||
|
mallard.performFly();
|
||
|
|
||
|
Duck model = new ModelDuck;
|
||
|
model.performQuack();
|
||
|
model.performFly();
|
||
|
model.setFlyBehavior(new FlyRocketPowered);
|
||
|
model.performFly();
|
||
|
}
|