Exemplo n.º 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");
            }
        }
Exemplo n.º 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("");
        }
Exemplo n.º 3
0
 public Box(BoxStrategy strategy)
 {
     BoxStrategy = strategy;
 }
Exemplo n.º 4
0
 public void OpenBox(BoxStrategy boxStrategy)
 {
     Ikey.OpenBox(boxStrategy);
 }