Ejemplo n.º 1
0
  private static ColorString getWeaponStatusString(final String ws) {
    Color color = null;
    String string = null;

    // TODO: A HashMap would be more efficient.
    if (ws.equals("R")) {
      color = MUColors.g;
      string = " Ready";
    } else if (ws.equals("*")) {
      color = MUColors.hx;
      string = " *****";
    } else if (ws.equals("A") || ws.equals("a") || ws.equals("J")) {
      color = MUColors.r;
      string = "JAMMED";
    } else if (ws.equals("D")) {
      color = MUColors.hx;
      string = "DISBLD";
    } else if (ws.equals("S")) {
      color = MUColors.r;
      string = "SHORTD";
    } else {
      // FIXME: rightJust() shouldn't be in MUUnitInfo.
      string = MUUnitInfo.rightJust(ws, 6, false);
    }

    return new ColorString(color, string);
  }