Пример #1
0
        private void promptAddCapacity()
        {
            if (_lastDayAttemptedToBuyCapacity == _game.DaysLeft)
            {
                return;
            }

            _llAddCapacity.Enabled         = false;
            _lastDayAttemptedToBuyCapacity = _game.DaysLeft;
            BuySellForm buyCapacity = new BuySellForm(null, _game.Player, Actions.BuyCapacity);

            buyCapacity.ShowDialog(this);
            outputGameState();
        }
Пример #2
0
        private void showSellForm(OwnedGum gum)
        {
            MarketGum marketGum = _game.CurrentCity.FindGum(gum);

            if (marketGum == null)
            {
                return;
            }

            if (gum != null)
            {
                BuySellForm buySellForm = new BuySellForm(marketGum, _game.Player, Actions.Sell);
                buySellForm.ShowDialog(this);
                outputGameState();
            }
        }
Пример #3
0
        private void doubleClickMarketRow(int rowNumber)
        {
            if (_game.DaysLeft == 0)
            {
                MessageBox.Show("You cannot buy when there are 0 days left");
                return;
            }

            foreach (DataGridViewRow row in _grdMarket.Rows)
            {
                if (row.Index != rowNumber)
                {
                    continue;
                }
                MarketGum gum = row.DataBoundItem as MarketGum;
                if (gum != null)
                {
                    BuySellForm buySellForm = new BuySellForm(gum, _game.Player, Actions.Buy);
                    buySellForm.ShowDialog(this);
                    outputGameState();
                }
            }
        }