public Game(Board board, Set<Pawn> pawns) {
        if (board == null || pawns == null)
            throw new NullPointerException();
        this.board = board;
        // Filter dead pawns
        Set<Pawn> pbuf = new HashSet<Pawn>();
        for (Pawn p : pawns)
            if (p.isAlive())
                pbuf.add(p);
        this.pawns = Collections.unmodifiableSet(new HashSet<Pawn>(pbuf));
        // Map coordinates
        Map<Vector, Pawn> cbuf = new HashMap<Vector, Pawn>();
        for (Pawn p : pbuf)
            if (cbuf.containsKey(p.getLocation()))
                throw new IllegalArgumentException("More than one pawn at " + p.getLocation());
            else
                cbuf.put(p.getLocation(), p);
        coords = Collections.unmodifiableMap(cbuf);
        // Build teams
        Map<Integer, Set<Pawn>> tbuf = new HashMap<Integer, Set<Pawn>>();
        for (Pawn p : pbuf) {
            Set<Pawn> s = tbuf.get(p.getTeam());
            if (s == null) {
                s = new HashSet<Pawn>();
                tbuf.put(p.getTeam(), s);
            }
            s.add(p);
        }
        Map<Integer, Set<Pawn>> team = new HashMap<Integer, Set<Pawn>>();
        for (Map.Entry<Integer, Set<Pawn>> e : tbuf.entrySet())
            team.put(e.getKey(), Collections.unmodifiableSet(e.getValue()));
        this.teams = Collections.unmodifiableMap(team);
    }