private void btnStart_Click(object sender, EventArgs e) { timer.Enabled = true; ShopCasher shopCasger = new ShopCasher(int.Parse(tbxCasher.Text), int.Parse(tbxCount.Text)); CaffeCasher caffeCasher = new CaffeCasher(int.Parse(tbxCaffe.Text)); Shop shop = new Shop(shopCasger, caffeCasher); shopControl = new ShopControl(shop, dtpOpen.Value, dtpClose.Value, int.Parse(tbxMaxCount.Text)); shopControl.UpdateEvent += UpdateInfo; }
private void GoToCaffe(CaffeCasher casher) { int value = rnd.Next(101); if (value < m_probability) { m_state = BuyerState.CaffeEnter; BuyerStateChengedEvent(this, new BuyerStateEventArgs(m_state)); casher.Pay(); m_state = BuyerState.CaffeLeave; BuyerStateChengedEvent(this, new BuyerStateEventArgs(m_state)); } }