forked from s425077/PotatoPlan
Inventory System added into ai
This commit is contained in:
parent
e1b4dec764
commit
4173b26d30
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user