if (type.equals("B")) {
return new BuildingTarget(coords, board, Boolean.parseBoolean(target.nextToken()));
}
if (type.equals("M")) {
return new MinefieldTarget(coords, board);
}
return new HexTarget(coords, board, Integer.parseInt(target.nextToken()));
}