diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-19 00:22:07 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-19 00:22:07 +0100 |
commit | e518b17f855549d540d4aa6bad2c2a785521a106 (patch) | |
tree | 674b23d8f3c7b75aa4f6295cde1e33e64b446acd /core/src/ch/asynk | |
parent | 0db9753ccf10b06c083dd24d2c1e0b2064f9afd3 (diff) | |
download | RustAndDust-e518b17f855549d540d4aa6bad2c2a785521a106.zip RustAndDust-e518b17f855549d540d4aa6bad2c2a785521a106.tar.gz |
OrderList: add dispose(Pawn, Order.OrderType)
Diffstat (limited to 'core/src/ch/asynk')
-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) |