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/adapter/simpleadapter/lib/turkeyadapter.d

28 lines
346 B
D

module lib.turkeyadapter;
import lib.turkey;
import lib.duck;
class TurkeyAdapter : Duck
{
Turkey turkey;
this(Turkey turkey)
{
this.turkey = turkey;
}
void quack()
{
turkey.gobble();
}
void fly()
{
foreach (val; 0..5)
{
turkey.fly();
}
}
}