From 2909874fec33a83a70310d9aabe201c2d0d858b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 22 Apr 2016 11:12:15 +0200 Subject: OrderList: add Order getId(int) --- core/src/ch/asynk/rustanddust/game/OrderList.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/ch/asynk/rustanddust/game/OrderList.java b/core/src/ch/asynk/rustanddust/game/OrderList.java index 98cc741..7a8e3f3 100644 --- a/core/src/ch/asynk/rustanddust/game/OrderList.java +++ b/core/src/ch/asynk/rustanddust/game/OrderList.java @@ -22,6 +22,15 @@ public class OrderList extends IterableArray return null; } + public Order getId(int id) + { + for (Order o : this) { + if (o.id == id) + return o; + } + return null; + } + public void dispose(Unit unit) { Iterator it = iterator(); -- cgit v1.1-2-g2b99