Exemplo n.º 1
0
  /**
   * @param red
   * @param green
   * @param blue
   * @param type
   */
  public ConfigFirework(String type, boolean flicker, int red, int green, int blue) {
    super(red, green, blue);

    this.flicker = flicker;
    try {
      this.type = Type.valueOf(type);
    } catch (Exception e) {
    }

    if (type == null && r == null) {
      r = new Random();
    }
  }
Exemplo n.º 2
0
	@Override
	public boolean setOptions(final String[] options) {
		// target;power;type;R;G;B

		if (options.length < 6)
			return false;

		target = options[0];
		power = Integer.parseInt(options[1]);
		type = Type.valueOf(options[2].toUpperCase().replace(" ", "_"));
		colour = Color.fromRGB(Integer.parseInt(options[3]), Integer.parseInt(options[4]),
				Integer.parseInt(options[5]));
		// Colour is RGB code

		return target != null;
	}