2020-04-08 20:04:31 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
|
|
|
|
|
class Crops
|
|
|
|
|
{
|
2020-05-03 13:05:05 +02:00
|
|
|
|
public int x;
|
|
|
|
|
public int y;
|
2020-04-08 20:04:31 +02:00
|
|
|
|
public int Status;
|
2020-05-03 13:05:05 +02:00
|
|
|
|
private int cropType;
|
2020-04-08 20:04:31 +02:00
|
|
|
|
private int Timer;
|
|
|
|
|
private Random r;
|
2020-05-03 13:05:05 +02:00
|
|
|
|
|
2020-04-08 20:04:31 +02:00
|
|
|
|
|
|
|
|
|
public void updateCrop()
|
|
|
|
|
{
|
|
|
|
|
if (Status != 0)
|
|
|
|
|
{
|
|
|
|
|
Timer--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getCropTimer()
|
|
|
|
|
{
|
|
|
|
|
return Timer;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-03 13:05:05 +02:00
|
|
|
|
public int getCostOnMovement()
|
2020-04-08 20:04:31 +02:00
|
|
|
|
{
|
2020-05-03 13:05:05 +02:00
|
|
|
|
if (Status == 1)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else if (Status == 2)
|
|
|
|
|
{
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
else if (Status == 3)
|
|
|
|
|
{
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
2020-04-08 20:04:31 +02:00
|
|
|
|
}
|
2020-05-03 13:05:05 +02:00
|
|
|
|
|
2020-04-08 20:04:31 +02:00
|
|
|
|
|
|
|
|
|
public void setPosition(int newx, int newy)
|
|
|
|
|
{
|
|
|
|
|
x = newx;
|
|
|
|
|
y = newy;
|
|
|
|
|
}
|
2020-05-03 13:05:05 +02:00
|
|
|
|
|
|
|
|
|
public void setCropType(int Type)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2020-04-08 20:04:31 +02:00
|
|
|
|
}
|