From d4e5e1f73b6ac7e0b06a2fe749b8f90376df9f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 9 Jan 2016 19:02:29 +0100 Subject: TileSet: extends ArrayListIt --- core/src/ch/asynk/rustanddust/engine/TileSet.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/TileSet.java b/core/src/ch/asynk/rustanddust/engine/TileSet.java index 76fa3a1..9531549 100644 --- a/core/src/ch/asynk/rustanddust/engine/TileSet.java +++ b/core/src/ch/asynk/rustanddust/engine/TileSet.java @@ -1,8 +1,8 @@ package ch.asynk.rustanddust.engine; -import java.util.LinkedHashSet; +import ch.asynk.rustanddust.engine.util.ArrayListIt; -public class TileSet extends LinkedHashSet +public class TileSet extends ArrayListIt { private final Board board; @@ -17,4 +17,12 @@ public class TileSet extends LinkedHashSet for (Tile tile : this) board.enableOverlayOn(tile, i, enable); } + + @Override + public boolean add(Tile tile) + { + if (contains(tile)) return false; + super.add(tile); + return true; + } } -- cgit v1.1-2-g2b99