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); }
private void FillBoard() { // основные характеристики startBoardX = 20; startBoardY = 0; newBoardX = 0; isFirstX = true; foreach (var flight in game.GetFlightsInfo()) { AddFlight(flight); } }