예제 #1
0
 public void CalculateNewSpeed(int fuel)
 {
     SetSpeed(GetSpeed() + 50 - fuel);
     SetFuel(GetFuel() - fuel);
     SetHeight(GetHeight() - speed);
     mlh.AddRound(GetHeight(), GetSpeed());
 }
예제 #2
0
        // adjust speed, fuel, and height
        public void CalculateNewSpeed(int nFuel)
        {
            speed   = (speed + 50 - nFuel);
            height -= speed;

            // to keep from getting a height that's negative
            if (height < 0)
            {
                height = 0;
            }
            fuel -= nFuel;
            mlh.AddRound(height, speed);
        }
예제 #3
0
        public int calcNewSpeedHeight(int input)
        {
            mlh.AddRound(height, speed);

            int newSpeed;

            newSpeed = getSpeed() + 50 - input;

            setSpeed(newSpeed);
            reduceFuel(input);
            setHeight(getHeight() - getSpeed());


            return(newSpeed);
        }
예제 #4
0
        // you'll need to add data fields & methods so that the rest of the program
        // can use the various properties of the lander (such as height, speed, etc)


        public MarsLander()
        {
            mlh.AddRound(height: initialHeight, speed: intitialSpeed);
            current = mlh.Last();
        }