Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
        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("");
        }
Beispiel #3
0
 public Box(BoxStrategy strategy)
 {
     BoxStrategy = strategy;
 }
Beispiel #4
0
 public void OpenBox(BoxStrategy boxStrategy)
 {
     Ikey.OpenBox(boxStrategy);
 }