diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/OrderList.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/OrderList.java b/core/src/ch/asynk/tankontank/engine/OrderList.java index 287f374..60b0545 100644 --- a/core/src/ch/asynk/tankontank/engine/OrderList.java +++ b/core/src/ch/asynk/tankontank/engine/OrderList.java @@ -17,6 +17,18 @@ public class OrderList extends LinkedList<Order> } } + public void dispose(Pawn pawn, Order.OrderType type) + { + Iterator<Order> it = iterator(); + while(it.hasNext()) { + Order order = it.next(); + if ((order.compareTo(pawn) == 0) && (order.isA(type))) { + it.remove(); + order.dispose(); + } + } + } + public void dispose() { for (Order o : this) |