示例#1
0
    }//ServeClient

    public void CookAndServe()
    {
        List <BasicAI> toRemove = new List <BasicAI>();

        for (int i = 0; i < orderedQueue.Count; i++)
        {
            BasicAI client = orderedQueue[i];
            if (!cooking.ContainsKey(client))
            {
                GameUtils.Utils.WarningMessage(client.name + " has no cooking food?!");
                continue;
            }//if
            Recepe foodOnTheGrill = cooking[client];
            bool   isCooked       = foodOnTheGrill.Cook(Time.deltaTime);
            if (isCooked)
            {
                toRemove.Add(client);
                ServeClient(client, foodOnTheGrill);
            } //if cooked
        }     //for
        foreach (BasicAI served in toRemove)
        {
            if (!cooking.ContainsKey(served))
            {
                continue;
            }
            //Destroy(cooking[served].gameObject);
            cooking.Remove(served);
        } //foreach
    }     //Cook
示例#2
0
    }//Order

    public float RecieveOrder(Recepe toRecieve)
    {
        this.eState = StateMachine.walking;

        _thoughtsProcessor.ShowFeedback(FeedbackThoughts.Feedbacks.Happy, true);
        //TODO: calculate satisfaction value and tip percent
        return(1);
    }//RecieveOrder
示例#3
0
    }//TakeOrder

    public void ServeClient(BasicAI client, Recepe toServe)
    {
        float cash = client.RecieveOrder(toServe);

        _shopStorage.Cash += cash;
        if (orderedQueue.Contains(client))
        {
            orderedQueue.Remove(client);
        }
    }//ServeClient
示例#4
0
        internal Recepe Find(Slot[] Grid)
        {
            string key = Recepe.GetKeyFromGrid(Grid);

            if (recepies.ContainsKey(key))
            {
                return(recepies[key]);
            }
            return(null);
        }
示例#5
0
        public void TestRecipe()
        {
            Product.Content.Clear();
            Recepe recepe = CraftingTableRecipes.Instance.Find(Grid);

            if (recepe == null)
            {
                return;
            }
            Product.Content.ReplaceWith(recepe.Product);
        }
示例#6
0
    }//MoveTowardsDirection

    public void SetState(StateMachine newState)
    {
        eState = newState;
        if (eState == StateMachine.standingInLine)
        {
            foodToOrder = (FoodPref.Length == 0) ?_shop.PickAnyFromMenu() : foodToOrder = pickFoodFromPrefs();
            if (foodToOrder == null)
            {
                eState = StateMachine.walking;
                return;
            }
            waitTime = Random.Range(MaxWaitingTime.x, MaxWaitingTime.y);
        }
    }//SetState
示例#7
0
    }//RemoveFromWaitQueue

    /// <summary>
    ///  Take order from the clinet (in the queue). Cook the
    /// food for Food.cooktime seconds and serve it when ready.
    /// </summary>
    public void TakeOrder()
    {
        if (orderedQueue.Count >= 2)
        {
            return;
        }
        if (waitingQueue.Count == 0)
        {
            return;
        }

        var client = waitingQueue[0];

        RemoveFromWaitQueue(client);

        orderedQueue.Add(client);
        //dispose food for the client if he ordered before,
        //but food was not removed from the grill.
        DisposeCooked(client);
        Recepe foodToCook = new Recepe();

        cooking.Add(client, foodToCook);
    }//TakeOrder
示例#8
0
    }//DisposeCooked

    /// <summary>
    ///  Check if desiered food is in the shop's menu.
    /// Return True if recepe exists. False = no such food.
    /// </summary>
    /// <param name="toFind">Food to find in the menu</param>
    /// <returns></returns>
    public bool CheckFoodInMenu(Recepe toFind)
    {
        //FIXME
        return(true);
    }//CheckFoodInMenu
示例#9
0
 protected void AddRecipe(Recepe recepe)
 {
     recepies.Add(recepe.Key, recepe);
 }