コード例 #1
0
        static void Main(string[] args)
        {
            Owner     owner     = new Owner();
            Safe      safe      = new Safe();
            Locksmith locksmith = new Locksmith();

            locksmith.OpenSafe(safe, owner);
            JewelThief thief = new JewelThief();

            thief.OpenSafe(safe, owner);
            Console.ReadKey();
        }
コード例 #2
0
ファイル: Safe.cs プロジェクト: walkersoft/head-first-c-sharp
 public void PickLock(Locksmith lockpicker)
 {
     lockpicker.WriteDownCombination(safeCombination);
 }