public void Drive(ResContainer r) { Y = r._Ride.EndY; X = r._Ride.EndX; CarTime += r.TimeOfDrive; Rides.Add(r._Ride.ID); Program.Atlas.RemoveRide(r._Ride.StartY, r._Ride.StartX, r._Ride); Program._Points.Remove(r._point); if(CarTime >= Program.T) EndRun(); }
public ResContainer(ResContainer rold, int minretdist) { waitTime = rold.waitTime; ApproachDistance = rold.ApproachDistance; _Ride = rold._Ride; Bonus = rold.Bonus; TimeOfDrive = ApproachDistance + _Ride.Distance + waitTime; PointsEarned = _Ride.Distance; _point = rold._point; if (Bonus) this.PointsEarned += Program.B; TimeProportion = (double)this.TimeOfDrive / (double)(ApproachDistance + waitTime + minretdist); }