Чистые виртуальные методы в C #?

Мне сказали сделать мой класс абстрактным:

public abstract class Airplane_Abstract

И сделать метод под названием move виртуальным

 public virtual void Move()
        {
            //use the property to ensure that there is a valid position object
            double radians = PlanePosition.Direction * (Math.PI / 180.0);

            // change the x location by the x vector of the speed
            PlanePosition.X_Coordinate += (int)(PlanePosition.Speed * Math.Cos(radians));

            // change the y location by the y vector of the speed
            PlanePosition.Y_Coordinate += (int)(PlanePosition.Speed * Math.Sin(radians));
        }

И эти 4 других метода должны быть «чистыми виртуальными методами». Что это такое?

Все они сейчас выглядят так:

public virtual void TurnRight()
{
    // turn right relative to the airplane
    if (PlanePosition.Direction >= 0 && PlanePosition.Direction < Position.MAX_COMPASS_DIRECTION)
        PlanePosition.Direction += 1;
    else
        PlanePosition.Direction = Position.MIN_COMPASS_DIRECTION;  //due north
}
39
задан Kara 28 June 2013 в 23:52
поделиться