anchor.diff:  end;
   
   procedure TMapReaderJson.DeStreamTile(Encoded: string; Tile: PMapTile);
  +
  +  function ParseFlip(Src: AnsiChar): Uint8;
  +  begin
  +    //('_','-','|','+');
  +    case Src of
  +      '_': Result := 0;
  +      '-': Result := 1;
  +      '|': Result := 2;
  +      '+': Result := 3;
  +    else
  +      raise Exception.CreateFmt('Invalid tile flip %s',[Src]);
  +    end;
  +  end;
  +
   var
     terrainCode: String;
     tt: TTerrainType;
  
positive.code:   if not FTileExpression.Exec(Encoded) then
       raise Exception.CreateFmt('Invalid tile format %s',[Encoded]);
  
    if (FTileExpression.MatchLen[1]=0) or (FTileExpression.MatchLen[2]=0) then
      raise Exception.CreateFmt('Invalid tile format %s',[Encoded]);
  
    terrainCode := FTileExpression.Match[1];
    tt := FTerrainTypeMap.KeyData[terrainCode];
    Tile^.TerType:=tt;
    Tile^.TerSubType:= StrToInt(FTileExpression.Match[2]);
  
    if FTileExpression.MatchLen[3]>0 then
    begin
      Assert(FTileExpression.MatchLen[4]>0);
      Assert(FTileExpression.MatchLen[5]>0);
  
      Tile^.RoadType:= UInt8(FRoadTypeMap[FTileExpression.Match[4]]);
      Tile^.RoadDir:= StrToInt(FTileExpression.Match[5]);;
    end;
  
    if FTileExpression.MatchLen[6]>0 then
    begin
      Assert(FTileExpression.MatchLen[7]>0);
      Assert(FTileExpression.MatchLen[8]>0);
  
      Tile^.RiverType:= UInt8(FRiverTypeMap[FTileExpression.Match[7]]);
      Tile^.RiverDir:= StrToInt(FTileExpression.Match[8]);
    end;
  
    if FTileExpression.MatchLen[9]>0 then
    begin
      Assert(FTileExpression.MatchLen[10]>0);
      Tile^.Flags:=StrToInt(FTileExpression.Match[10]);
    end;
  
  end;
  
negative.code: 
    //1-tt, 2 - tst ,  4-pt, 5-pst, 7-rt, 8 - rst , 10- flags
  
  //  FTileExpression.Expression:='^(\w{2,2})(\d+)((p\w)(\d+))?((r\w)(\d+))?(f(\d+))?$';
  
    //1-tt, 2 - tcode, 3 - tflip , 4-road (5 6 7) 8 - river (9 10 11)
  
    FTileExpression.Expression:='^(\w{2,2})(\d+)(.)((p\w)(\d+)(.))?((r\w)(\d+)(.))?$';
  
    FTileExpression.Compile;
  end;
  
  