package eco;

/**
 * This class represents wheat and associated methods, including the wheat
 * stockpile
 * 
 * @author phil, nate, will, connor
 * 
 */

public class Wheat {

	private static int tWheat;
	private static int wheatPrice;

	public static int tWheat(int farmers) {
		tWheat += farmers * Farmer.getWheatProductionRate();
		return tWheat;
	}

	public static int eatWheat(int request) {
		if (request > tWheat) {
			int diff = request - tWheat;
			tWheat = 0;
			return diff;
		} else {
			tWheat -= request;
			return 0;
		}
	}

	public static int gettWheat() {
		return tWheat;
	}

	public static void settWheat(int tWheat) {
		Wheat.tWheat = tWheat;
	}

	public static int getWheatPrice() {
		return wheatPrice;
	}

	public static void setWheatPrice(int wheatPrice) {
		Wheat.wheatPrice = wheatPrice;
	}

}

@@ -231,16 +231,91 @@
 Price;%0A%0A
+%09private static int maxwheat = 5000;%0A%09private static int minwheat = 1000;%0A%0A
 %09public 
@@ -347,16 +347,16 @@
 mers) %7B%0A
-
 %09%09tWheat
@@ -466,16 +466,130 @@
 uest) %7B%0A
+%09%09if (tWheat %3C minwheat)%7B%0A%09%09  int toBuy = minwheat - tWheat;%0A%09          tWheat += Economy.buyWheat(toBuy);%09%09%0A%09%09%7D%09%0A
 %09%09if (re
@@ -908,20 +908,149 @@
 tPrice;%0A
-
 %09%7D%0A%0A
+%09public static void update()%7B%0A%09%09if (tWheat %3E maxwheat)%7B%0A%09%09%09Economy.sellWheat(tWheat - maxwheat);%0A%09%09%09tWheat = maxwheat;%09%0A%09%09%7D%0A%09%7D%09%0A%0A
 %09public 

Update Wheat.java