Exemple #1
0
        public PlaneMarket(IGameLogicInteractable game, Plane.Models model, int days)
        {
            InitializeComponent();
            BackColor        = MainForm.MostlyBackColor;
            btnBuy.BackColor = MainForm.MostlyBackColor;
            cbType.BackColor = MainForm.MostlyBackColor;
            cbType.Items.AddRange(new object[] { "Покупка", "Аренда", "Лизинг" });
            Bitmap picture = null;

            switch (model)
            {
            case Plane.Models.TY_134:
            {
                picture = Resources.AirbusA330_200;
            }
            break;

            case Plane.Models.SuperJet123:
            {
                picture = Resources.Boeing747_8i;
            }
            break;

            case Plane.Models.KukuruznikMX150:
            {
                picture = Resources.McDonnelDouglasMD11F;
            }
            break;
            }
            this.model = model;
            this.game  = game;
            PlaneName  = model.ToString();
            PlaneCharacteristics chars = PlaneCharacteristicsStorage.Characteristics[model];

            SpeedValue = chars.Speed;
            RangeValue = chars.Range;
            SetMaxValue(chars.MaxSeatings, chars.Payload);
            DaysValue = days;

            PriceValue           = game.GetBuyPrice(model);
            cbType.SelectedIndex = 0;
        }
Exemple #2
0
        public FlightData(bool isPassenger, Flight flight, IGameLogicInteractable game)
        {
            InitializeComponent();

            this.game   = game;
            this.flight = flight;

            BackColor        = MainForm.MostlyBackColor;
            btnGet.BackColor = MainForm.MostlyBackColor;

            if (isPassenger)
            {
                lblFlightType.Text          = "Пассажиры:";
                lblFlightType.Width         = 109;
                lblFlightTypeValue.Location = new Point(124, 55);
            }
            else
            {
                lblFlightType.Text          = "Грузоподъемность:";
                lblFlightType.Width         = 175;
                lblFlightTypeValue.Location = new Point(190, 55);
            }
        }
        public PlaneData(PlaneDataType type, IGameLogicInteractable game, List <City> cities, Plane plane)
        {
            InitializeComponent();

            this.plane  = plane;
            this.game   = game;
            this.cities = cities;
            this.type   = type;
            planes      = game.GetPlanes();
            plane.DeprecationDegreeChanged += Plane_DeprecationDegreeChanged;

            BackColor             = MainForm.MostlyBackColor;
            btnFly.BackColor      = MainForm.MostlyBackColor;
            btnSell.BackColor     = MainForm.MostlyBackColor;
            lblCityName.BackColor = MainForm.MostlyBackColor;
            switch (type)
            {
            case PlaneDataType.SelectPlane:
            {
                btnFly.Visible        = false;
                lblPrice.Visible      = false;
                lblPriceValue.Visible = false;
                lblType.Visible       = false;
                lblTypeValue.Visible  = false;
                lblCityName.Visible   = false;
                lblCity.Visible       = false;
                btnSell.Visible       = false;

                RangeValue = plane.Range;
                SetMaxValue(plane.MaxSeatings, plane.Payload);
            } break;

            case PlaneDataType.TransferPlane:
            {
                rbCheck.Visible       = false;
                lblPrice.Visible      = false;
                lblPriceValue.Visible = false;
                lblType.Visible       = false;
                lblTypeValue.Visible  = false;
                btnSell.Visible       = false;
                lblRange.Visible      = false;
                lblRangeValue.Visible = false;
                lblMax.Visible        = false;
                lblMaxValue.Visible   = false;
            } break;

            case PlaneDataType.SellPlane:
            {
                btnFly.Visible       = false;
                rbCheck.Visible      = false;
                lblType.Visible      = false;
                lblTypeValue.Visible = false;
                lblCity.Visible      = false;
                lblCityName.Visible  = false;
                RangeValue           = plane.Range;
                SetMaxValue(plane.MaxSeatings, plane.Payload);
            } break;
            }
            switch (plane.Own)
            {
            case Plane.Owns.Rented:
                lblMarketContract.Text  = "Аренда:";
                lblMarketDaysValue.Text = plane.MarketC.Days.ToString() + " д.";
                break;

            case Plane.Owns.Bought:
                lblMarketDaysValue.Visible = false;
                lblMarketContract.Visible  = false;
                break;

            case Plane.Owns.Leased:
                if (Plane.MarketC.Days > 0)
                {
                    lblMarketContract.Text  = "Лизинг:";
                    lblMarketDaysValue.Text = plane.MarketC.Days.ToString() + " д.";
                }
                else
                {
                    lblMarketDaysValue.Visible = false;
                    lblMarketContract.Visible  = false;
                }
                break;
            }
        }