Пример #1
0
 public void OnSaladServed(SaladType saladType, PlayerController owner)
 {
     m_LastServedOwner = owner;
     if (saladType == m_SaladType)
     {
         GameManager.Instance.pGameEventSystem.TriggerEvent(GameEventsList.PlayerEvents.ON_SALAD_SERVE_SUCCESS, new OnSaladServedEventArgs(m_SaladType, m_LastServedOwner, this.gameObject.GetComponent <Customer>()));
     }
     else
     {
         GameManager.Instance.pGameEventSystem.TriggerEvent(GameEventsList.PlayerEvents.ON_SALAD_SERVE_FAIL, new OnSaladServedEventArgs(m_SaladType, m_LastServedOwner, this.gameObject.GetComponent <Customer>()));
     }
 }
Пример #2
0
    // Public method for transferring ingredients from one salad instance to another
    public void MoveSalad(GameObject newSalad)
    {
        // Transfer all ingredient values from this salad into a the new salad
        SaladType s = newSalad.GetComponent <SaladType>();

        s.numLettuce = numLettuce;
        s.numTomato  = numTomato;
        s.numCarrot  = numCarrot;
        s.numCheese  = numCheese;
        s.numTurnip  = numTurnip;
        s.numCaper   = numCaper;
    }
Пример #3
0
        public static double GetSaladPrice(SaladType saladType)
        {
            switch (saladType)
            {
            case SaladType.Greek:
                return(22.50);

            case SaladType.Caesar:
                return(23.75);

            case SaladType.Garden:
                return(24.10);

            case SaladType.Chicken:
                return(25.99);

            case SaladType.Seafood:
                return(29.95);

            default:
                throw new ArgumentException("This salad's price is not on our menu!");
            }
        }
Пример #4
0
    public Salad CreateSalad(SaladType saladType)
    {
        GameObject go = (GameObject)Instantiate(Resources.Load(SALAD_ASSETS_PATH + "/" + saladType.ToString()));

        return(go.GetComponent <Salad>());
    }
Пример #5
0
 public Salad(SaladType itemName, double price)
 {
     ItemName = itemName;
     Price    = price;
 }
 public OnSaladServedEventArgs(SaladType salType, PlayerController player, Customer cus)
 {
     saladType        = salType;
     playerController = player;
     customer         = cus;
 }