Пример #1
0
 public void StartCatchingPlane(PlaneView plane, EndAircraftCarrierTile carrierTile)
 {
     isCatchingPlane = true;
     if (carrierTile == null)
     {
         activeArrestingWires.Clear();
         activeArrestingWires.Add(arrestingWires[0]);
     }
     else
     {
         activateClosestArrestingWires(plane);
     }
     planeBeingCaught = plane;
 }
Пример #2
0
        /// <summary>
        /// Zwraca pozycje (pozycje pocz¹tku) ostatniego elementu
        /// EndAircraftCarrierTile na liœcie tile.(plus pewna niedok³adoœæ
        /// wynikaj¹ca z niedok³adnoœci modelu w view a szerokoœci¹ tile).
        /// </summary>
        /// <returns></returns>
        /// <author>Tomek</author>
        public PointD GetEndPosition()
        {
            EndAircraftCarrierTile endTile = null;

            //poszukaj restore tile
            foreach (AircraftCarrierTile tile in carrierTiles)
            {
                if (tile is EndAircraftCarrierTile)
                {
                    endTile = (EndAircraftCarrierTile)tile;
                }
            }

            //sprawdz czy znalaz³
            if (endTile == null)
            {
                throw new Exception("Nie odnaleziono obiektu RestoreAmmunitionCarrierTile");
            }

            return(new PointD(Mathematics.IndexToPosition(endTile.TileIndex), endTile.YBegin * LevelTile.TileWidth));
        }
        public PlaneOnAircraftTestForm()
        {
            InitializeComponent();
            //przerobione przez Emila:
            level = new Level("levels/level-1.dat", null, PlaneType.P47);
            //level.UserPlane.StartEngine();

            //  level.Controller

            List <AircraftCarrierTile> list  = new List <AircraftCarrierTile>();
            BeginAircraftCarrierTile   begin =
                new BeginAircraftCarrierTile(0.4f, 0.5f, 0, new Quadrangle(new PointD(10, 10), 100, 50));
            MiddleAircraftCarrierTile middle =
                new MiddleAircraftCarrierTile(0.4f, 0.5f, 0, new Quadrangle(new PointD(10, 10), 190, 50));
            EndAircraftCarrierTile end =
                new EndAircraftCarrierTile(0.4f, 0.5f, 0, new Quadrangle(new PointD(190, 10), 100, 50));

            list.Add(begin);
            list.Add(middle);
            list.Add(end);
            aircraft = new Carrier(list);

            timerMain.Start();
        }
Пример #4
0
 /// <summary>
 /// Funkcja zostaje wywołana gdy lina hamująca zwalnia samolot.
 /// </summary>
 /// <param name="plane"></param>
 /// <param name="carrierTile"></param>
 public void OnReleasePlane(Plane plane, EndAircraftCarrierTile carrierTile)
 {
     AddJob(MethodBase.GetCurrentMethod().Name, new object[] { plane, carrierTile });
 }
Пример #5
0
 public void OnReleasePlane(Plane plane, EndAircraftCarrierTile carrierTile)
 {
     levelView.OnReleasePlane(plane, carrierTile);
     currentLevel.OnReleaseLine(carrierTile);
 }
Пример #6
0
 public void OnCatchPlane(Plane plane, EndAircraftCarrierTile carrierTile)
 {
     levelView.OnCatchPlane(plane, carrierTile);
 }