public void SetContext(CustomerStateContext context)
    {
        _stateContext = context;
        _stateContext.StateMachine = this;

        _enterShopState.SetContext(_stateContext);
        _interactState.SetContext(_stateContext);
        _goToInteractState.SetContext(_stateContext);
        _exitShopState.SetContext(_stateContext);

        ChangeState(_enterShopState);
    }
Exemple #2
0
    private void SpawnNewCustomerAndSetIfForInteraction()
    {
        var nonBusyInteractionPoint = _interactablesHolder.GetNonBusyInteractableObject();

        if (nonBusyInteractionPoint is null)
        {
            return;
        }

        nonBusyInteractionPoint.IsBusy = true;

        var newCustomer = _factory.SpawnNewCustomer(_customerSpawnPoint.position);

        CustomerStateContext stateContext = new CustomerStateContext();

        stateContext.CustomerInteractPoint = nonBusyInteractionPoint;
        stateContext.EventsRelay           = _eventsReley;
        stateContext.ShopEnterPoint        = _shopEnter.position;
        stateContext.ShopExitPoint         = _shopExit.position;

        newCustomer.SetContext(stateContext);
    }
Exemple #3
0
 public void SetContext(CustomerStateContext context)
 {
     context.CurrentCustomer = this;
     _stateMachine.SetContext(context);
 }
Exemple #4
0
 public void SetContext(CustomerStateContext context)
 {
     _stateContext = context;
 }