Exemplo n.º 1
0
 public MediumRare(double currentTemp, SteakContext steak)
 {
     this.currentTemp = currentTemp;
     this.steak       = steak;
     canEat           = true;
     Initialize();
 }
Exemplo n.º 2
0
 public Rare(double currentTemp, SteakContext steak)
 {
     this.currentTemp = currentTemp;
     this.steak       = steak;
     canEat           = true; //We can now eat the steak
     Initialize();
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var player = new DVDPlayerContext();

            player.PressPlayButton();
            player.PressMenuButton();
            player.PressPlayButton();
            player.PressPlayButton();
            player.PressMenuButton();
            player.PressPlayButton();
            player.PressPlayButton();

            Account account = new Account("Jim Johnson");

            // Apply financial transactions

            account.Deposit(500.0);
            account.Deposit(300.0);
            account.Deposit(550.0);
            account.PayInterest();
            account.Withdraw(2000.00);
            account.Withdraw(1100.00);

            //Let's cook a steak!
            SteakContext steakies = new SteakContext("T-Bone");

            // Apply temperature changes
            steakies.AddTemp(120);
            steakies.AddTemp(15);
            steakies.AddTemp(15);
            steakies.RemoveTemp(10); //Yes I know cooking doesn't work this way, bear with me.
            steakies.RemoveTemp(15);
            steakies.AddTemp(20);
            steakies.AddTemp(20);
            steakies.AddTemp(20);

            Console.ReadKey();
        }