small update

This commit is contained in:
BOTLester 2020-05-10 15:02:22 +02:00
parent 2375a52cd4
commit aee7262c45
3 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,8 @@ class Tractor
private Path path = new Path();
private SmartTractor smartTractor = new SmartTractor();
private HandleRotation handleRotation = new HandleRotation();
private int j = 60;
public void updateSizing(Input input, int Status, Vector2 newHousePos, DayNightCycle Time)
{
@ -61,7 +63,6 @@ class Tractor
public void updatePosition(Vector2 Size, int Status) // updates the position
{
//farm.updateSize(Size, sizeTile, Spacing);
for (int i = 0; i < Speed; i++)
{

View File

@ -18,6 +18,7 @@ class AI
private FertilizerHolder fertilizerHolder = new FertilizerHolder();
private int Rotation;
private Astar astar = new Astar();
public bool WaitTwoFrames { get; set; }
private Random r = new Random();
@ -95,6 +96,7 @@ class AI
int y = (int)tractorPos.Y;
Fertilizer fertilizer = new Fertilizer();
fertilizerHolder.init();
WaitTwoFrames = false;
if (farm.getCrop(x, y).getStatus() >= 2)
{
fertilizer = fertilizerHolder.GetFertilizer(Engine.PredictFertilizer(farm.getCrop(x, y), farm.getPresetCropTypes(farm.getCrop(x, y).getCropType())));
@ -102,6 +104,7 @@ class AI
{
farm.getCrop(x, y).Fertilize(fertilizer);
fertilizer = fertilizerHolder.GetFertilizer(Engine.PredictFertilizer(farm.getCrop(x, y), farm.getPresetCropTypes(farm.getCrop(x, y).getCropType())));
WaitTwoFrames = true;
//System.Threading.Thread.Sleep(5);
}
}

View File

@ -24,9 +24,8 @@ class SmartTractor
//astar.update(farm.getCrops(), Size, tractorPos / (tileSize + Spacing), housePos / (tileSize + Spacing), Target / (tileSize + Spacing), Rotation);
if (tractorPos == housePos)
ai.reloadCargo();
return ai.newTarget();
//return astar.FindPath(true);
}
@ -85,4 +84,14 @@ class SmartTractor
{
return ai.getInventory();
}
public bool getWaitTwoFrames()
{
return ai.WaitTwoFrames;
}
public void setWaitTwoFrames(bool input)
{
ai.WaitTwoFrames = input;
}
}