public ItemTypeSelector() { InitializeComponent(); for (int x = 0; x < ObjTemplate.MAX_ITEM_TYPE; x++) { cbItemType.Items.Add(ObjTemplate.ItemTypeString((ObjTemplate.ObjectType)x)); } }
void UpdateWindowContents(Shop shop) { txtKeeperIndexNumber.Text = shop.Keeper.ToString(); txtBuyPercent.Text = shop.PercentBuy.ToString(); txtSellPercent.Text = shop.PercentSell.ToString(); txtOpenHour.Text = shop.OpenHour.ToString(); txtCloseHour.Text = shop.CloseHour.ToString(); lstBuyTypes.Items.Clear(); foreach (int item in shop.BuyTypes) { lstBuyTypes.Items.Add(ObjTemplate.ItemTypeString((ObjTemplate.ObjectType)item)); } lstItemsForSale.Items.Clear(); foreach (int item in shop.ItemsForSale) { lstItemsForSale.Items.Add(item.ToString()); } }