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);
 }
 protected override void ReturnContents(string safeContents, SafeOwner owner)
 {
     stolenJewels = safeContents;
     Console.WriteLine($"I'm stealing the jewels! I stole: {stolenJewels}");
 }