anchor.diff:    //Comparison function could be executed more rare or frequent depending on signals from houses/serfs
     //e.g. with no houses signals it can sleep till first on. At any case - not more frequent than 1/tick
     //TKMDeliveryList = class; //Serfs, Houses/Warriors/Workers
  -
  -  {$IFDEF USE_HASH}
  -  TKMDeliveryCache = class(TDictionary<TKMDeliveryBidKey, TKMDeliveryBid>)
  -  public
  -    function TryGetValue(const aKey: TKMDeliveryBidKey; var aValue: TKMDeliveryBid): Boolean; reintroduce;
  -    procedure Add(const FromP: TKMPoint; ToP: TKMPoint; const aValue: Single; const aTimeToLive: Word); reintroduce; overload;
  -    procedure Add(const aKey: TKMDeliveryBidKey; const aValue: Single; const aTimeToLive: Word); reintroduce; overload;
  -    procedure Add(const aKey: TKMDeliveryBidKey; const aBid: TKMDeliveryBid); reintroduce; overload;
  -  end;
  -  {$ENDIF}
  -
   
     TKMDeliveries = class
     private
  
positive.code:   TKMDeliveryBid = record
      Value: Single;
      TimeToLive: Integer; //Cached bid time to live, we have to update it from time to time
    end;
    {$ENDIF}
  
  
negative.code: 
  {$ENDIF}
  
  { TKMDeliveryBidKey }
  function TKMDeliveryBidKey.GetHashCode: Integer;
  var
    total: Int64;
  begin
    //HashCode should be the same if we swap From and To
    Int64Rec(total).Words[0] := (FromP.X + ToP.X);
    Int64Rec(total).Words[1] := Abs(FromP.X - ToP.X);
    Int64Rec(total).Words[2] := FromP.Y + ToP.Y;
    Int64Rec(total).Words[3] := Abs(FromP.Y - ToP.Y);
    Result := THashBobJenkins.GetHashValue(total, SizeOf(Int64), 0);
  end;
  
  end.
  