Пример #1
0
    /*public void SlideRail()
     * {
     *  ticketList.RemoveAll(x => x == null);
     *
     *  indexer = railPosition.IndexOf(ticketList.Last().GetComponent<Ticket>().item_pos);
     *  up = false;
     * }
     * /*
     *         int count = ticketList.Count;
     *  Vector3 moveUnits = new Vector3(-35, 0, 0);
     *  //float waitTime = 0.04f;
     *  // Vector3 buffer = Vector3.zero;
     *  for (int i = destroyedIndex; i < ticketList.Count; i++)
     *  {
     *      start = ticketList[i].transform.position;
     *      end = ticketList[i].transform.position + Vector3.left * moveDistance;
     *      Debug.Log("DESTROYED INDEX RIGHT HERE -------___-------------__------------>>>>>>>> " + destroyedIndex.ToString());
     *      currentLerpTime += Time.deltaTime;
     *      if (currentLerpTime > lerpTime)
     *      {
     *          currentLerpTime = lerpTime;
     *      }
     *      float perc = currentLerpTime / lerpTime;
     *      ticketList[i].transform.position = Vector3.Lerp(start, end, perc);
     *  }
     *  yield return new WaitForEndOfFrame();
     *  Debug.Log("INDEXER AT TEND OF SLIDERAIL()------------------------> " + indexer.ToString());
     *  Debug.Log("LAST ITEM VECTOR IN TICKET LIST =====================-> " + ticketList.Last().GetComponent<Ticket>().item_pos);if (!yield return new WaitForSeconds(waitTime);
     *      ticketList[i].transform.Translate( Vector3.left * 35 * speed * waitTime);
     *          ticketList[i].GetComponent<Ticket>().index--;[i].GetComponent<Ticket>().isFirst)
     *          buffer = new Vector3(-35f, -10f);
     *
     *      if (ticketList[i] != null)
     *      {
     *          while (Vector3.Distance(ticketList[i].transform.position, ticketList[i].transform.position + buffer ) > 0)
     *          {
     *              yield return new WaitForSeconds(waitTime);
     *              ticketList[i].transform.position = Vector3.MoveTowards(ticketList[i].transform.position, ticketList[i].transform.position + buffer, speed * waitTime);
     *
     *              if (Vector3.Distance(ticketList[i].transform.position, ticketList[i].transform.position + buffer) == 0)
     *                  break;
     *          }*/
    public void CreateOrder()
    {
        numTops        = Random.Range(1, 6);
        itemsPerTicket = Random.Range(1, 3);
        Orders         = SammichHelper.MakeOrder(numTops, itemsPerTicket);
        int DickLength1;
        int DickLength2;

        if (Orders.Count > 1)
        {
            DickLength1 = Orders[0].ToString().Length;
            DickLength2 = Orders[1].ToString().Length;
            ProperDick  = TheDicks[DickLength1];
            ProperDick2 = TheDicks[DickLength2];
        }
        else
        {
            DickLength1 = Orders[0].ToString().Length;
            ProperDick  = TheDicks[DickLength1];
        }
    }
Пример #2
0
    /* Will update this as we push!
     * ---------------------------
     * Create order makes the key(s) for the item(s) on each ticket
     * Logic is as follows:
     * 1. Initialize numTops - The number of toppings that each sandwhich is comprised of via topping ID
     *    Initialize itemsPerTicket - Obviously it's the number of items per ticket. I'm going to write it so that we can have up to
     *    5 items per ticket, but for testing purposes we should  probably stick with 1-2 per.
     *
     * 2. Switch statement takes the case of numTops - The number of toppings determine the sandwhich that will be created.
     *    In each case, List <string> Orders is assigned the return value of MakeOrder (See SammichHelper.cs) - this is our list of items to
     *    display on the ticket.
     *    Then, ProperDick is assigned the value of the appropriate dictionary of Sprites ( See Sandwhiches.cs). Break out of Switch.
     *
     * 3. We then check to see if there is more than one item. If so , all we need to do is point to which dictionary each sprite in the List
     *    should use (assigned to ProperDick2). Note that we are NOT running MakeOrder again in the second Switch statement. All
     *    sammich keys in the list are generated in MakeOrder in the first Switch.
     *    THEN WE DONE HERE --> CreateOrder();
     */
    public void CreateOrder()
    {
        numTops        = Random.Range(0, 6);
        itemsPerTicket = Random.Range(0, 3);

        switch (numTops)
        {
        case 1:
            Orders     = (SammichHelper.MakeOrder(numTops, itemsPerTicket));
            ProperDick = Sandwiches.OneTopsDick;
            Debug.Log("TICKETS ORDER CHAOS :" + Orders[0]);
            break;

        case 2:
            Orders     = SammichHelper.MakeOrder(numTops, itemsPerTicket);
            ProperDick = Sandwiches.TwoTopsDick;
            SammichHelper.PrintAList("TICKETS ORDER @ CASE 2: ", Orders, -1);
            break;

        case 3:
            Orders     = SammichHelper.MakeOrder(numTops, itemsPerTicket);
            ProperDick = Sandwiches.ThreeTopsDick;
            SammichHelper.PrintAList("TICKETS ORDER @ CASE 3: ", Orders, -1);
            break;

        case 4:
            Orders     = SammichHelper.MakeOrder(numTops, itemsPerTicket);
            ProperDick = Sandwiches.FourTopsDick;
            SammichHelper.PrintAList("TICKETS ORDER @ CASE 4: ", Orders, -1);
            break;

        case 5:
            Orders     = SammichHelper.MakeOrder(numTops, itemsPerTicket);
            ProperDick = Sandwiches.FiveTopsDick;
            SammichHelper.PrintAList("TICKETS ORDER @ CASE 5: ", Orders, -1);
            break;

        default:
            break;
        }
        if (itemsPerTicket > 1)
        {
            for (int i = 1; i < Orders.Count; i++)
            {
                int x = Orders[i].Length;
                Debug.Log("ORDERS LENGTH PEOPLE: " + Orders[i].Length + " " + Orders[i]);

                switch (x)
                {
                case 1:
                    ProperDick2 = Sandwiches.OneTopsDick;
                    break;

                case 2:
                    ProperDick2 = Sandwiches.TwoTopsDick;
                    SammichHelper.PrintAList("TICKETS ITEM @ CASE 2 PT2: ", Orders, i);
                    break;

                case 3:
                    ProperDick2 = Sandwiches.ThreeTopsDick;
                    SammichHelper.PrintAList("TICKETS ITEM @ CASE 3 PT2: ", Orders, i);
                    break;

                case 4:
                    ProperDick2 = Sandwiches.FourTopsDick;
                    SammichHelper.PrintAList("TICKETS ITEM @ CASE 4 PT2: ", Orders, i);
                    break;

                case 5:
                    ProperDick2 = Sandwiches.FiveTopsDick;
                    SammichHelper.PrintAList("TICKETS ITEM @ CASE 5 PT2: ", Orders, i);
                    break;

                default:
                    break;
                }
            }
        }
    }