Inventory System added into ai

This commit is contained in:
Joel 2020-05-09 13:48:28 +02:00
parent e1b4dec764
commit 4173b26d30

View File

@ -25,15 +25,6 @@ class AI
public void init() public void init()
{ {
inventory.initInventorySystem(); inventory.initInventorySystem();
inventory.addItem(1, 1);
inventory.addItem(1, 1);
inventory.addItem(3, 1);
inventory.addItem(5, 1);
inventory.addItem(7, 1);
inventory.addItem(7, 1);
inventory.addItem(10, 1);
inventory.addItem(10, 1);
inventory.useItem(10, 1);
} }
@ -110,6 +101,11 @@ class AI
if (farm.getCrop((int)tractorPos.X, (int)tractorPos.Y).getCropTimer() == 1) if (farm.getCrop((int)tractorPos.X, (int)tractorPos.Y).getCropTimer() == 1)
{ {
farm.setCropStatus(tractorPos.X, tractorPos.Y); farm.setCropStatus(tractorPos.X, tractorPos.Y);
if (farm.getCrop((int)tractorPos.X, (int)tractorPos.Y).getStatus() == 2)
{
inventory.addItem(farm.getCrop((int)tractorPos.X, (int)tractorPos.Y).getCropType() - 1, 1);
}
} }
return farm; return farm;
} }