public void assignDropoff( Receiver reciever ) { if( reciever != default(Receiver) ) { status = "assigned"; dropoff = reciever; } else { // throw error } }
public Receiver findBestDropOff( Receiver[] receivers ) { if( receivers.Length == 0 ) { return default(Receiver); } int best = 0; double currentDist = this.location.difference(receivers[0].location); for( int i = 0; i < receivers.Length; ++i ) { double tmp = this.location.difference(receivers[i].location); if( tmp < currentDist ) { best = i; currentDist = tmp; } } return receivers[best]; }
public Driver( string uname, string upass, GPS loc ) : base(uname, upass, "Driver", loc) { pickup = null; dropoff = null; }
public Driver() : base("","","Driver",null) { pickup = null; dropoff = null; }