/// <summary> /// Implements leaving of the customer. /// Sets _hasFinished to true. /// Sets _wasSatisfied to true or false depending on whether or not the time ran out. /// Also see if the player is supposed to be happy if the customer was served correct order and to gift if the time remaining was more than 70% /// Lastly invokes CustomerLeft action read by SeatController to which it was referenced. /// </summary> private void Leave( ) { _customerModel._hasFinished = true; _customerModel._wasSatisfied = _customerModel._time > 0; if (_customerModel._wasSatisfied) { _customerView.LookHappy( ); } if ((_customerModel._time / _originalTime) >= (_percentOfTimeForGifting / 100)) { GiftPlayer.Invoke(_customerModel._servingPlayer); } CustomerLeft.Invoke(_customerModel._wasSatisfied, _customerModel._isAngry, _customerModel._servingPlayer); StartCoroutine(StartLeaving( )); }