예제 #1
0
        private void lbItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CCBStoreItem selItem = GetCurrentItem();

            if (null != selItem)
            {
                SetTextboxInt(tbCost, selItem.Cost);
                if (-1 == selItem.Count)
                {
                    labelLimit.Visibility = Visibility.Hidden;
                    tbLimit.Visibility    = Visibility.Hidden;
                }
                else
                {
                    labelLimit.Visibility = Visibility.Visible;
                    tbLimit.Visibility    = Visibility.Visible;
                    SetTextboxInt(tbLimit, selItem.Count);
                }
                btnDeleteItem.IsEnabled = true;
            }
            else
            {
                btnDeleteItem.IsEnabled = false;
            }
        }
예제 #2
0
        private void AddItemsToStore(CCBStore store, CCBStorePlaceType place, Random rnd)
        {
            foreach (CCBPotentialStoreItem maybeItem in place.StoreItems.Items)
            {
                if (maybeItem.IncludeInStore(rnd))
                {
                    CCBStoreItem newItem = new CCBStoreItem(maybeItem.Item);

                    newItem.Cost  = maybeItem.GetCost(rnd);
                    newItem.Count = maybeItem.GetLimit(rnd);
                    if (0 == newItem.Count)
                    {
                        store.Add(new CCBStoreItemOmitted(maybeItem.Item, "Limited"));
                    }
                    else
                    {
                        store.Add(newItem);
                    }
                }
                else
                {
                    store.Add(new CCBStoreItemOmitted(maybeItem.Item, "Chance"));
                }
            }
        }
예제 #3
0
        private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
        {
            CCBStoreItem item = GetCurrentItem();

            if (null != item)
            {
                int ixCur = lbItems.SelectedIndex;

                m_store.RemoveItem(item);
                lbItems.Items.RemoveAt(ixCur);
                SelectListboxItem(lbItems, ixCur);
            }
        }
예제 #4
0
        private void Save()
        {
            CCBStoreItem item = GetCurrentItem();

            if (null != item)
            {
                item.Cost = IntFromTextbox(tbCost);
                if (tbLimit.IsVisible)
                {
                    item.Count = IntFromTextbox(tbLimit);
                }
            }
        }
예제 #5
0
 public StoreItemViewer(CCBBagItem bagItem)
 {
     m_item = (CCBStoreItem)bagItem;
 }
예제 #6
0
 public StoreItemViewer(CCBStoreItem storeItem)
 {
     m_item = storeItem;
 }
예제 #7
0
 private void AddStoreItem(CCBStoreItem storeItem)
 {
     lbItems.Items.Add(storeItem);
 }