This repository has been archived on 2022-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
2022-11-09 21:22:13 +00:00
|
|
|
module strategy.app;
|
|
|
|
|
|
|
|
import strategy.duck;
|
2022-11-09 21:29:18 +00:00
|
|
|
import strategy.flybehavior;
|
2022-11-09 21:22:13 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
Duck mallard = new MallardDuck;
|
|
|
|
mallard.performQuack();
|
|
|
|
mallard.performFly();
|
|
|
|
|
|
|
|
Duck model = new ModelDuck;
|
|
|
|
model.performQuack();
|
|
|
|
model.performFly();
|
2022-11-09 21:29:18 +00:00
|
|
|
model.setFlyBehavior(new FlyRocketPowered);
|
|
|
|
model.performFly();
|
2022-11-09 21:22:13 +00:00
|
|
|
}
|