Exemplo n.º 1
0
 public void StartInspectingShelf(DisplayShelf shelf)
 {
     if (!CheckShelvesList(shelf))
     {
         StopCoroutine("InspectShelf");
         StartCoroutine(InspectShelf(shelf));
     }
 }
Exemplo n.º 2
0
 public bool CheckShelvesList(DisplayShelf toCheck)
 {
     foreach (DisplayShelf shelf in checkedShelves)
     {
         if (shelf == toCheck)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
    public string GetObjectDescription(StoreObject obj)
    {
        DisplayShelf possibleDisplayShelf = obj.GetComponent <DisplayShelf>();

        if (possibleDisplayShelf != null)
        {
            return("Shelf used to hold products");
        }
        BudtenderCounter possibleBudtenderCounter = obj.GetComponent <BudtenderCounter>();

        if (possibleBudtenderCounter != null)
        {
            return("Opens " + possibleBudtenderCounter.stations.Count + " budtender jobs.  Budtenders assist customers and keep your shelves stocked");
        }
        CheckoutCounter possibleCheckoutCounter = obj.GetComponent <CheckoutCounter>();

        if (possibleCheckoutCounter != null)
        {
            return("Place for customers to check out");
        }
        return("Error: " + obj.ToString());
    }
Exemplo n.º 4
0
 IEnumerator InspectShelf(DisplayShelf shelf)
 {
     /* checkedShelves.Add(shelf);
      * List<ProductPosition> shelfPositions = shelf.positions;
      * bool inspectingProduct = false;
      * int inspectTimer = 0;
      * int desiredProductMaxTime = 350;
      * int regularMaxTime = UnityEngine.Random.Range(60, 250);
      * Product product = null;
      * bool productDesired = false; // If the product is highly desired.  Causes customer to look at it longer
      * bool regularDesired = false; // If the product is just regular, look at it a short while
      * while (currentIndex < shelfPositions.Count)
      * {
      *   if (!checkedIndex && !inspectingProduct)
      *   {
      *       checkedIndex = true;
      *       ProductPosition thisPos = shelfPositions[currentIndex];
      *       if (thisPos != null)
      *       {
      *           Product thisProduct = thisPos.product;
      *           if (thisProduct != null)
      *           {
      *               product = thisProduct;
      *               inspectingProduct = true;
      *               float interest = GenerateInterest(product);
      *               print(product.GetName() + " " + interest);
      *               pathfinding.GeneratePathToPosition(thisPos.transform.position, RaiseIndex);
      *           }
      *           pathfinding.GeneratePathToPosition(thisPos.transform.position);
      *       }
      *   }
      *   else if (!checkedIndex && inspectingProduct)
      *   {
      *       if (product != null)
      *       {
      *           if (productDesired)
      *           {
      *               if (inspectTimer >= desiredProductMaxTime)
      *               {
      *                   inspectingProduct = false;
      *                   inspectTimer = 0;
      *               }
      *           }
      *           else
      *           {
      *               if (inspectTimer > regularMaxTime)
      *               {
      *                   regularMaxTime = UnityEngine.Random.Range(60, 250);
      *                   inspectingProduct = false;
      *                   inspectTimer = 0;
      *               }
      *           }
      *       }
      *       inspectTimer++;
      *   }
      *   else
      *   {
      *       inspectTimer++;
      *       if (inspectTimer > regularMaxTime) // Timeout
      *       {
      *           RaiseIndex();
      *           inspectingProduct = false;
      *           inspectTimer = 0;
      *       }
      *   }
      *   yield return null;
      * }
      */
     pathfinding.FinishSequentialAction();
     yield return(null);
 }
Exemplo n.º 5
0
 public InspectShelf(DisplayShelf shelf_) : base(ActionType.sequence)
 {
     shelf = shelf_;
     SetupDictionary();
 }