updateFromNeighbor method

DistanceVectorRouteEntry<T> updateFromNeighbor(
  1. T neighbor,
  2. num newCost,
  3. int newHopCount
)

Updates the route with new information from a neighbor

Implementation

DistanceVectorRouteEntry<T> updateFromNeighbor(
  T neighbor,
  num newCost,
  int newHopCount,
) {
  return copyWith(
    cost: newCost,
    hopCount: newHopCount,
    advertisingNeighbor: neighbor,
    lastUpdate: DateTime.now(),
  );
}