If you think the Android project blocks-game listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package cz.kotu.game.blocks.hex;
//www.java2s.comimport java.util.HashMap;
import java.util.Map;
/**
* @author Kotuc
*/publicclass HexGrid<T> {
publicfinal Map<Axial, T> map = new HashMap<Axial, T>();
public HexGrid() {
}
public T get(int q, int r) {
return map.get(new Axial(q, r));
}
public T get(Axial pos) {
return map.get(pos);
}
public T set(int q, int r, T val) {
return set(new Axial(q, r), val);
}
public T set(Axial pos, T val) {
return map.put(pos, val);
}
}