Skip to content
Snippets Groups Projects
Commit 5561b648 authored by Marco Matthies's avatar Marco Matthies
Browse files

Move createevent calls from CropState to FarmPlot sow! and harvest! functions

parent 1e52e259
No related branches found
No related tags found
No related merge requests found
......@@ -195,10 +195,9 @@ end
Change the cropstate to sow the specified crop.
"""
function sow!(cs::CropState, model::SimulationModel, cropname::String)
createevent!(model, farmplot.pixels, sowing)
#XXX test if the crop is sowable?
cs.croptype = model.crops[cropname]
cs.phase = ALMaSS.sow
#XXX test if the crop is sowable?
end
"""
......@@ -207,7 +206,6 @@ end
Harvest the crop of this cropstate.
"""
function harvest!(cs::CropState, model::SimulationModel)
createevent!(model, farmplot.pixels, harvesting)
cs.phase in [ALMaSS.harvest1, ALMaSS.harvest2] ?
cs.phase = ALMaSS.harvest2 :
cs.phase = ALMaSS.harvest1
......
......@@ -30,9 +30,9 @@ end
Sow the specified crop on the farmplot.
"""
function sow!(farmplot::FarmPlot, model::SimulationModel, cropname::String)
#XXX test if the crop is sowable?
createevent!(model, farmplot.pixels, sowing)
sow!(farmplot.crop_state, model, cropname)
#XXX test if the crop is sowable?
end
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment