public void OpenSafe(Safe safe, Owner owner) { safe.PickLock(this); Jewels safeContents = safe.Open(givenCode); ReturnContents(safeContents, owner); }
public virtual void ReturnContents(Jewels safeContents, Owner owner) { owner.ReceiveContents(safeContents); }
// "override" keyword overrides patrimonial "virtual" ReturnContents method public override void ReturnContents(Jewels safeContents, Owner owner) { stolenJewels = safeContents; Console.WriteLine("I'm steal the contents of the safe!" + stolenJewels.Sparkle()); }
public void ReceiveContents(Jewels safeContents) { returnedContents = safeContents; Console.WriteLine("Thanks for bringing jewels. " + safeContents.Sparkle()); }