static void Main(string[] args) { Soldier s = new Soldier(); Gun gun = new Gun(); s.Attack(gun); Knife k = new Knife(); IFireArms knifeAttak = new KnifeToFireArmsAdapter(k); s.Attack(knifeAttak); Console.Read(); }
public KnifeToFireArmsAdapter(Knife k) { knife = k; }