Ejemplo n.º 1
0
        public void OpenSafe(Safe safe, SafeOwner owner)
        {
            safe.PickLock(this);
            string safeContents = safe.Open(Combination);

            ReturnContents(safeContents, owner);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            SafeOwner  owner      = new SafeOwner();
            Safe       safe       = new Safe();
            JewelThief jewelThief = new JewelThief();

            jewelThief.OpenSafe(safe, owner);
            Console.ReadKey(true);
        }
Ejemplo n.º 3
0
 protected virtual void ReturnContents(string safeContents, SafeOwner owner)
 {
     owner.ReceiveContents(safeContents);
 }
Ejemplo n.º 4
0
 protected override void ReturnContents(string safeContents, SafeOwner owner)
 {
     _stolenJewels = safeContents;
     Console.WriteLine($"I'm steeling the jewels. I stole {_stolenJewels}");
 }