Beispiel #1
0
 private void FindWork()
 {
     foreach (Table t in this.TablesUnderDuty)
     {
         if (t.HasOrder())
         {
             this.currentTask  = WaiterTask.GetOrder;
             this.currentTable = t;
             break;
         }
         if (t.IsReadyForCheck())
         {
             this.currentTask  = WaiterTask.GetCheck;
             this.currentTable = t;
             break;
         }
     }
     foreach (FoodOrder food in this.OwnKitchen.DoneOrders)
     {
         if (food.forTable.ResponsibleWaiter == this)
         {
             this.currentTask  = WaiterTask.GetFood;
             this.currentTable = food.forTable;
             break;
         }
     }
 }
Beispiel #2
0
    private void GetCheckFromTable(Table t)
    {
        if (!IsEnrouteToTable(t))
        {
            this.LookingDirection = t.GetStandingAngle();

            this.CarriedOrder = t.Order;
            this.currentTask  = WaiterTask.GetReciept;
        }
    }
Beispiel #3
0
 public void DetectDogAt(Vector3 pos)
 {
     if (this.currentTask != WaiterTask.ChaseDog && this.currentTask != WaiterTask.PartolForDog)
     {
         control.detectors++;
         this.tabledTask = this.currentTask;
     }
     this.currentTask          = WaiterTask.ChaseDog;
     this.LastKnownDogLocation = pos;
     this.ChaseCoolDown        = DogSearchTime;
 }
Beispiel #4
0
 private void GetReceipt()
 {
     if (!IsEnrouteToRegister())
     {
         this.LookingDirection = OwnRegister.GetStandingAngle();
         if (this.CarriedOrder.Status == FoodOrder.OrderStatus.Check)
         {
             this.CarriedOrder.DoWork(Time.deltaTime);
         }
         else
         {
             this.currentTask = WaiterTask.ReturnReciept;
         }
     }
 }
Beispiel #5
0
    private void PatrolForDog()
    {
        const int searchRadius = 20;

        if (Random.value < 0.01)
        {
            this.meshAgent.SetDestination(Human.RandomVector(searchRadius, LastKnownDogLocation));
        }
        LookAt(this.meshAgent.steeringTarget);
        this.SearchCoolDown -= Time.deltaTime;
        if (this.SearchCoolDown <= 0)
        {
            control.detectors--;
            this.currentTask = this.tabledTask;
        }
    }
Beispiel #6
0
    private void GetFoodForTable(Table t)
    {
        if (!IsEnrouteToKitchen())
        {
            this.LookingDirection = OwnKitchen.GetStandingAngle();

            foreach (FoodOrder food in this.OwnKitchen.DoneOrders)
            {
                if (food.forTable == t)
                {
                    this.CarriedOrder = food;
                    break;
                }
            }
            this.OwnKitchen.DoneOrders.Remove(this.CarriedOrder);
            this.currentTask  = WaiterTask.DeliverFood;
            this.currentTable = t;
        }
    }
Beispiel #7
0
    private void ChaseDog()
    {
        LookAt(LastKnownDogLocation);
        if (Vector3.Distance(this.transform.position, LastKnownDogLocation) > 5)
        {
            this.meshAgent.SetDestination(LastKnownDogLocation);
        }
        else
        {
            this.MoveTo(LastKnownDogLocation);
        }

        this.ChaseCoolDown -= Time.deltaTime;
        if (this.ChaseCoolDown <= 0)
        {
            this.currentTask    = WaiterTask.PartolForDog;
            this.SearchCoolDown = DogSearchTime * 2;
        }
    }
Beispiel #8
0
 private void GetTableOrder(Table t)
 {
     if (!IsEnrouteToTable(t))
     {
         this.LookingDirection = t.GetStandingAngle();
         if (t.Order.Status == FoodOrder.OrderStatus.Idea)
         {
             t.Order.DoWork(Time.deltaTime);
         }
         else if (t.Order.Status == FoodOrder.OrderStatus.Order)
         {
             this.CarriedOrder = t.Order;
             this.currentTask  = WaiterTask.PlaceOrder;
         }
         else
         {
             //Something went very wrong
         }
     }
 }
Beispiel #9
0
 private void SetWorkerIdle()
 {
     this.currentTask  = WaiterTask.Idle;
     this.currentTable = null;
     this.CarriedOrder = null;
 }