Exemplo n.º 1
0
    public override bool UseItem(Item otherItem)
    {
        if (otherItem is Oven)
        {
            //Baking
            bakeAmount++;

            if (bakeAmount > 40)
            {
                state = CakeState.Burned;
            }
            else if (bakeAmount >= bakeAmountRequried)
            {
                state = CakeState.Finished;
            }
            else
            {
                state = CakeState.Unbaked;
            }
        }

        return(true);
    }
Exemplo n.º 2
0
 public static void AddCakeState(CakeState cakeState)
 {
     Console.WriteLine(cakeState.State);
     CakeStates.Add(cakeState);
 }
Exemplo n.º 3
0
 public Cake(int bakeAmount, int bakeAmountRequried, CakeState state)
 {
     this.bakeAmount         = bakeAmount;
     this.bakeAmountRequried = bakeAmountRequried;
     this.state = state;
 }