summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game/HexSet.java
blob: 4382fdbb58f5001adc6d528efe1b393dc4149321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ch.asynk.rustanddust.game;

import java.util.Collection;
import java.util.LinkedHashSet;

import ch.asynk.rustanddust.engine.Tile;

public class HexSet extends LinkedHashSet<Hex>
{
    private final Map map;

    public HexSet(Map map, int n)
    {
        super(n);
        this.map = map;
    }

    public void enable(int i, boolean enable)
    {
        for (Hex hex : this)
            map.enableOverlayOn(hex, i, enable);
    }

    @SuppressWarnings("unchecked")
    public Collection<Tile> asTiles()
    {
        return (Collection) this;
    }
}