anchor.diff:  end;
   
   
  +//How many houses of certain type we have (assume all wip houses will be finished)
   function TKMayor.HouseCount(aHouse: THouseType): Integer;
   begin
     Result := fPlayers[fOwner].Stats.GetHouseQty(aHouse) + fPlayers[fOwner].Stats.GetHouseWip(aHouse);
   end;
   
   
  +//These houses are core for town development
   procedure TKMayor.BuildCore;
   begin
     with fDemandCore do
  
positive.code:   end;
  end;
  
  //Tell Mayor what proportions of army is needed
  procedure TKMayor.SetArmyDemand(FootmenDemand, PikemenDemand, HorsemenDemand, ArchersDemand: Single);
  begin
  
negative.code:   var
      CornProductionRate, CornConsumptionRate: Single;
    begin
      CornProductionRate := HouseCount(ht_Farm) * ProductionRate[rt_Corn];
      //With stable production rate we can assume consumption rate that would be required
      CornConsumptionRate := HouseCount(ht_Mill) * ProductionRate[rt_Flour]
                           + HouseCount(ht_Swine) * ProductionRate[rt_Pig] * 4
                           + HouseCount(ht_Stables) * ProductionRate[rt_Horse] * 4;
  
      if CornProductionRate >= CornConsumptionRate then
      begin
        //Let every industry think the extra belongs to it
        fDemandFood.Bread.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Mill) * ProductionRate[rt_Flour]) * 2;
        fDemandFood.Sausages.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Swine) * ProductionRate[rt_Pig] * 4) / 4 * 3;
        fDemandWeaponry.WoodenArmor.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Swine) * ProductionRate[rt_Skin] * 4) / 4 * 2;
        fDemandWeaponry.Horse.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Stables) * ProductionRate[rt_Horse] * 4) / 4;
      end
      else
      begin
        //Share proportionaly
        fDemandFood.Bread.FarmTheory := CornProductionRate / CornConsumptionRate * (HouseCount(ht_Mill) * ProductionRate[rt_Flour]) * 2;
        fDemandFood.Sausages.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Swine) * ProductionRate[rt_Pig]) / 4 * 3;
        fDemandWeaponry.WoodenArmor.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Swine) * ProductionRate[rt_Skin] * 4) / 4 * 2;
        fDemandWeaponry.Horse.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Stables) * ProductionRate[rt_Horse]) / 4;
      end;
    end;
  var
  