anchor.diff:      fRNG: TKMRandomNumberGenerator;
     protected
       procedure ClearCountVisitedArr();
  -    procedure MakeNewQueue();
       procedure InsertInQueue(aX,aY: Integer; aProbability: Single);
       function RemoveFromQueue(var aX,aY: SmallInt; var aProbability: Single): Boolean;
  -    function IsQueueEmpty(): boolean;
     public
       constructor Create(var aRNG: TKMRandomNumberGenerator; var aPointsArr: TKMPoint2Array; var aCount, aSearchArr: TInteger2Array; var aFillArr: TKMByte2Array);
       destructor Destroy; override;
  
positive.code: // This is class for resources in RMG because it is quite complicated task (randomly generate something which must look like original template but still different...)
    TKMFloodWithQueue = class
    private
      fActualIdx: Byte;
      fStartQueue, fEndQueue: TResElementPointer;
      fPointsArr: TKMPoint2Array;
      fSearchArr, fCount: TInteger2Array;
      fFillArr, fCountVisitedArr: TKMByte2Array;
  
negative.code:       fCountVisitedArr[Y,X] := 0;
  end;
  
  procedure TKMFloodWithQueue.InsertInQueue(aX,aY: Integer; aProbability: Single);
  var
    RE: TResElementPointer;
  begin
    New(RE);
    RE^.X := aX;
    RE^.Y := aY;
    RE^.Probability := aProbability;
    fQueue.Push(RE);
  end;
  
  function TKMFloodWithQueue.RemoveFromQueue(var aX,aY: SmallInt; var aProbability: Single): Boolean;
  var
    RE: TResElementPointer;
  begin
    Result := (fQueue.Count > 0);
    if Result then
    begin
      RE := fQueue.Pop;
      aX := RE^.X;
      aY := RE^.Y;
      aProbability := RE^.Probability;
      Dispose(RE);
    end;
  end;
  
  procedure TKMFloodWithQueue.FloodFillWithQueue(var aPointArr: TKMPointArray; var aCnt_FINAL, aCnt_ACTUAL, aRESOURCE: Integer; const aProbability, aPROB_REDUCER: Single; var aPoints: TKMPointArray);
  const
    PROTECT_COEF = 1;
  var
    I,X,Y,X2,Y2: SmallInt;
    Cnt, POMCnt: Integer;
  