1
0
forked from s425077/PotatoPlan
PotatoPlan/Game1/Sources/Smart/AI.cs
2020-05-05 16:27:45 +02:00

44 lines
920 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
class AI
{
private Vector2 tractorPos;
private Vector2 housePos;
private Crops[,] crops;
private Vector2 Size;
private Vector2 targetPos;
private int Rotation;
private Random r = new Random();
public void update(Crops[,] newCrops, Vector2 newSize, Vector2 newTractorPos, Vector2 newHousePos, Vector2 newtargetPos, int rotation)
{
tractorPos = new Vector2((int)newTractorPos.X, (int)newTractorPos.Y);
housePos = new Vector2((int)newHousePos.X, (int)newHousePos.Y);
targetPos = newtargetPos;
crops = newCrops;
Size = newSize;
Rotation = rotation;
}
public Vector2 newTarget()
{
return new Vector2(r.Next(0, (int)Size.X), r.Next(0, (int)Size.Y));
}
}