public void OpenBox(BoxStrategy boxStrategy) { var type = boxStrategy.GetType(); if (type == typeof(BronzeBox)) { Console.WriteLine($"Bronze key is opening : {boxStrategy.ToString()} "); } else { Console.WriteLine("this key is not suitable for this box"); } }
public void OpenBox(BoxStrategy boxStrategy) { //var type = boxStrategy.GetType(); //if (type == typeof(GoldenBox)) // Console.WriteLine($"Golden key is opening : {boxStrategy.ToString()} "); //else // Console.WriteLine("this key is not suitable for this box"); ///////////////////// //if (boxStrategy.HasKey(player)) // Console.WriteLine(""); }
public Box(BoxStrategy strategy) { BoxStrategy = strategy; }
public void OpenBox(BoxStrategy boxStrategy) { Ikey.OpenBox(boxStrategy); }