--
-- fruitTypeSugarbeet
--
-- @author Mobbingpapst
-- @date  05.04.2012

print("register fruit type: sugarbeet");
local hudFile = Utils.getFilename("mods/Meyenburg/Meyenburg/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/+++/Mes documents/My Games/FarmingSimulator2011/mods/Sugarbeet/sugarbeetHud.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;
 