예제 #1
0
    public void Execute()
    {
        _savedCustomerState = _customerSet.GetCustomerByIndex(_slotIndex);
        _activePlayer.deadCustomerStack.Push(_savedCustomerState.cardData);

        CustomerCardData card = _customerDeck.Pop() as CustomerCardData;

        if (card != null)
        {
            CustomerCardState newState = CustomerCardState.Create(card);
            _customerSet.SetCustomerAtIndex(_slotIndex, newState);
        }
        else
        {
            _customerSet.SetCustomerAtIndex(_slotIndex, null);
        }
    }
예제 #2
0
    private void _setupCustomerCards(CardDeck customerDeck)
    {
        ActiveCustomerSet customers = ActiveCustomerSet.Create();

        // Intentionally not using commands here, as we don't want to be able to
        // undo the first set of customers
        for (int i = 0; i < ActiveCustomerSet.kMaxActiveCustomers; ++i)
        {
            CustomerCardData  cardData  = customerDeck.Pop() as CustomerCardData;
            CustomerCardState cardState = CustomerCardState.Create(cardData);
            customers.SetCustomerAtIndex(i, cardState);
        }
        activeCustomerSet = customers;
    }