diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/OrderList.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/OrderList.java b/core/src/ch/asynk/rustanddust/engine/OrderList.java index 4488cfe..6fdd6e7 100644 --- a/core/src/ch/asynk/rustanddust/engine/OrderList.java +++ b/core/src/ch/asynk/rustanddust/engine/OrderList.java @@ -9,6 +9,17 @@ import com.badlogic.gdx.utils.JsonWriter.OutputType; public class OrderList extends LinkedList<Order> implements Json.Serializable { + public Order get(Pawn pawn, Order.OrderType type) + { + Iterator<Order> it = iterator(); + while(it.hasNext()) { + Order order = it.next(); + if ((order.compareTo(pawn) == 0) && (order.isA(type))) + return order; + } + return null; + } + public void dispose(Pawn pawn) { Iterator<Order> it = iterator(); |