Пример #1
0
 private void CollectWoodTask()
 {
     if (totalInventory.GetWoodTotal() <= 0)
     {
         //collect wood from trees
     }
     else
     {
         //collect stone from warehouse
     }
 }
Пример #2
0
    void SelectPickUpLocation() //step 0
    {
        if (toRequester)
        {
            if (resources.GetWood() > 0)
            {
                if (inventory.GetWoodTotal() >= resources.GetWood())
                {
                    closestSource = FindClosestObjectWithTag("Warehouse");
                    destination   = closestSource.transform;
                    ReserveItems(closestSource, resources);
                }
                else //add else if for woodcutter, once implemented
                {
                    closestSource = FindClosestObjectWithTag("Forest");
                    destination   = closestSource.transform;
                }
            }
            else if (resources.GetStone() > 0)
            {
                if (inventory.GetStoneTotal() >= resources.GetStone())
                {
                    closestSource = FindClosestObjectWithTag("Warehouse");
                    destination   = closestSource.transform;
                    ReserveItems(closestSource, resources);
                }
                else //add else if for stonemason, once implemented
                {
                    closestSource = FindClosestObjectWithTag("Stone");
                    destination   = closestSource.transform;
                }
            }
        }
        else
        {
            destination = task.getRequester();
        }

        currentTaskStep++;
    }