public Map(String name, short x, short y, MapData map)
  {
    this.type = Type.None;
    this.name = name;
    this.size = new short[]{x, y};
    if (map != null)
    {
      this.starts = map.startLocationList.size();
      this.geysers = map.geyserList.size();
      this.minerals = map.mineralFieldList.size();
      this.startingMinerals = 0;
      this.startingGeysers = 0;

      short[] start = map.mineralFieldList.get(0);
      for (short[] mineral : map.mineralFieldList)
        if (Math.pow(mineral[0] - start[0], 2) + Math.pow(mineral[1] - start[1], 2) < 50000)
          startingMinerals++;
      for (short[] geyser : map.geyserList)
        if (Math.pow(geyser[0] - start[0], 2) + Math.pow(geyser[1] - start[1], 2) < 50000)
          startingGeysers++;

      for (Type type : Type.class.getEnumConstants())
        if (Pattern.compile(type.name(), Pattern.CASE_INSENSITIVE).matcher(name).find())
          this.type = type;
        else if (Pattern.compile(type.name().replaceAll("_", ""), Pattern.CASE_INSENSITIVE).matcher(name).find())
          this.type = type;
        else if (Pattern.compile(type.name().replaceAll("_", " "), Pattern.CASE_INSENSITIVE).matcher(name).find())
          this.type = type;
    }
  }