--
-- fruitTypeBetterave
--
-- @author C.Schoch
-- @date  12.07.2009

print("register fruit type: sugarbeet");
local hudFile = Utils.getFilename("mods/Map_Fruits/sugarbeetHud.png", getUserProfileAppPath());
--						        (string name,			bool needsSeeding, 	bool allowsSeeding, 	bool hasStraw, 	int minHarvestingGrowthState, 	float pricePerLiter, 	float literPerQm, 		float seedUsagePerQm, 		float seedPricePerLiter, 	string hudFruitOverlayFilename) 	"C:/Documents and Settings/David/Mes documents/My Games/FarmingSimulator2009/mods/Betterave/betteraveHud.png"
FruitUtil.registerFruitType("sugarbeet",	true, 			true,			false, 		4, 			   			0.20, 			5, 				0.5, 				0.5, 				hudFile);	
	
--local origLoadStatsFromXML = QuickPlayMenu.loadStatsFromXML;
local origSowingMachineLoad = SowingMachine.load;

SowingMachine.load = function (self, xmlFile)
	if origSowingMachineLoad ~= nil then
		origSowingMachineLoad(self, xmlFile);
	end;
	
	self.seeds = {};
	local i = 1;
    for k, fruitType in pairs(FruitUtil.fruitTypes) do
        if fruitType.allowsSeeding then
            self.seeds[i] = fruitType.index;
			i = i + 1;
        end;
    end;	
end;
 