예제 #1
0
        public MainForm(IGameLogicInteractable game)
        {
            InitializeComponent();
            this.game = game;
            game.FlightProgressChanged += Game_FlightProgressChanged;
            game.GameOver += Game_GameOver;
            contracts      = game.GetContracts();
            contracts.CollectionChanged += Contracts_CollectionChanged;
            flights = game.GetFlightsInfo();
            flights.CollectionChanged += Flights_CollectionChanged;
            cities = game.GetCitiesInfo();
            planes = game.GetPlanes();
            planes.CollectionChanged += Planes_CollectionChanged;

            lblDateValue.Text    = game.GetCurrentDateTime().ToLongDateString();
            lblBalanceValue.Text = "$ " + game.GetSavings().ToString();
            lblTimeValue.Text    = game.GetCurrentDateTime().TimeOfDay.ToString("hh\\:mm");
            lblFuelValue.Text    = "$ " + game.GetFuelPrice().ToString();

            game.SavingsChanged   += Game_SavingsChanged;
            game.DateChanged      += Game_DateChanged;
            game.FuelPriceChanged += Game_FuelPriceChanged;

            btnUpOne.FlatAppearance.BorderSize   = 0;
            btnUpTwo.FlatAppearance.BorderSize   = 0;
            btnUpThree.FlatAppearance.BorderSize = 0;

            InitLayoutControls();
            StartupLayoutInit();
            FillPlanes(PlaneDataType.TransferPlane, userAiroportPlanes);
            FillContracts();
            FillBoard();
            FillPlanes(PlaneDataType.SellPlane, userMarketPlanesSell);
            FillPlanesMarket(userMarketPlanesBuy);
        }
예제 #2
0
 private void FillContracts()
 {
     // основные характеристики
     contractsStartX = 10;
     contractsStartY = 5;
     foreach (var contract in game.GetContracts())
     {
         AddContract(contract);
     }
     Controls.Add(userAiroportContracts);
 }