@@ -0,0 +1,1129 @@
+package eco.game;%0A%0Aimport java.util.ArrayList;%0A%0A/**%0A * This class defines a message with a location and duration.%0A * %0A * @author phil%0A * %0A */%0A%0Apublic class Message %7B%0A%0A%09private String message;%0A%09private float x;%0A%09private float y;%0A%09private int time;%0A%0A%09private static ArrayList%3CMessage%3E messages = new ArrayList%3CMessage%3E();%0A%0A%09public Message(String message, float x, float y) %7B%0A%09%09this.message = message;%0A%09%09this.x = x;%0A%09%09this.y = y;%0A%09%09time = 60 * 6;%0A%09%7D%0A%0A%09public Message(String message, float x, float y, int time) %7B%0A%09%09this.message = message;%0A%09%09this.x = x;%0A%09%09this.y = y;%0A%09%09this.time = time;%0A%09%7D%0A%0A%09public static ArrayList%3CMessage%3E getMessages() %7B%0A%09%09for (Message m : messages) %7B%0A%09%09%09m.time--;%0A%09%09%7D%0A%09%09for (int i = 0; i %3C messages.size(); i++) %7B%0A%09%09%09if (messages.get(i).time %3C= 0) %7B%0A%09%09%09%09messages.remove(i);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return messages;%0A%09%7D%0A%0A%09public float getX() %7B%0A%09%09return x;%0A%09%7D%0A%0A%09public void setX(float x) %7B%0A%09%09this.x = x;%0A%09%7D%0A%0A%09public float getY() %7B%0A%09%09return y;%0A%09%7D%0A%0A%09public void setY(float y) %7B%0A%09%09this.y = y;%0A%09%7D%0A%0A%09public String getMessage() %7B%0A%09%09return message;%0A%09%7D%0A%0A%09public static void addMessage(Message message) %7B%0A%09%09messages.add(message);%0A%09%7D%0A%0A%7D%0A

Create Message.java