public void OpenSafe(Safe safe, SafeOwner owner) { safe.PickLock(this); string safeContents = safe.Open(Combination); ReturnContents(safeContents, owner); }
static void Main(string[] args) { SafeOwner owner = new SafeOwner(); Safe safe = new Safe(); JewelThief jewelThief = new JewelThief(); jewelThief.OpenSafe(safe, owner); Console.ReadKey(true); }
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 steeling the jewels. I stole {_stolenJewels}"); }