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.
patterns/strategy/app.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();
}