/** * Sets the total Generic mana. Can not be negative. Negative values will be * logged and set to 0. * * @param generic total Generic mana. */ public void setGeneric(int generic) { this.generic = notNegative(generic, "Generic"); }
/** * Sets the total Any mana. Can not be negative. Negative values will be * logged and set to 0. * * @param any total Any mana. */ public void setAny(int any) { this.any = notNegative(any, "Any"); }
/** * Sets the total Red mana. Can not be negative. Negative values will be * logged and set to 0. * * @param red total Red mana. */ public void setRed(int red) { this.red = notNegative(red, "Red"); }
/** * Sets the total Black mana. Can not be negative. Negative values will be * logged and set to 0. * * @param black total Black mana. */ public void setBlack(int black) { this.black = notNegative(black, "Black"); }
/** * Sets the total Colorless mana. Can not be negative. Negative values will * be logged and set to 0. * * @param colorless total Colorless mana. */ public void setColorless(int colorless) { this.colorless = notNegative(colorless, "Colorless"); }
/** * Sets the total Green mana. Can not be negative. Negative values will be * logged and set to 0. * * @param green total Green mana. */ public void setGreen(int green) { this.green = notNegative(green, "Green"); }
/** * Sets the total Blue mana. Can not be negative. Negative values will be * logged and set to 0. * * @param blue total Blue mana. */ public void setBlue(int blue) { this.blue = notNegative(blue, "Blue"); }
/** * Sets the total White mana. Can not be negative. Negative values will be * logged and set to 0. * * @param white total White mana. */ public void setWhite(int white) { this.white = notNegative(white, "White"); }
/** * Creates a {@link Mana} object with the passed in values. Values can not * be less than 0. Any values less than 0 will be logged and set to 0. * * @param red total Red mana to have. * @param green total Green mana to have. * @param blue total Blue mana to have. * @param white total White mana to have. * @param black total Black mana to have. * @param generic total Generic mana to have. * @param any total Any mana to have. * @param colorless total Colorless mana to have. */ public Mana(final int red, final int green, final int blue, final int white, final int black, final int generic, final int any, final int colorless) { this.red = notNegative(red, "Red"); this.green = notNegative(green, "Green"); this.blue = notNegative(blue, "Blue"); this.white = notNegative(white, "White"); this.black = notNegative(black, "Black"); this.generic = notNegative(generic, "Generic"); this.colorless = notNegative(colorless, "Colorless"); this.any = notNegative(any, "Any"); this.flag = false; }
/** * Creates a {@link Mana} object with the passed in {@code num} of Generic * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of Generic mana to create. * @return a {@link Mana} object with the passed in {@code num} of Generic * mana. */ public static Mana GenericMana(int num) { return new Mana(0, 0, 0, 0, 0, notNegative(num, "Generic"), 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Green * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of Green mana to create. * @return a {@link Mana} object with the passed in {@code num} of Green * mana. */ public static Mana GreenMana(int num) { return new Mana(0, notNegative(num, "Green"), 0, 0, 0, 0, 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Any mana. * {@code num} can not be a negative value. Negative values will be logged * and set to 0. * * @param num value of Any mana to create. * @return a {@link Mana} object with the passed in {@code num} of Any mana. */ public static Mana AnyMana(int num) { return new Mana(0, 0, 0, 0, 0, 0, notNegative(num, "Any"), 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Blue * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of Blue mana to create. * @return a {@link Mana} object with the passed in {@code num} of Blue * mana. */ public static Mana BlueMana(int num) { return new Mana(0, 0, notNegative(num, "Blue"), 0, 0, 0, 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of White * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of White mana to create. * @return a {@link Mana} object with the passed in {@code num} of White * mana. */ public static Mana WhiteMana(int num) { return new Mana(0, 0, 0, notNegative(num, "White"), 0, 0, 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Red mana. * {@code num} can not be a negative value. Negative values will be logged * and set to 0. * * @param num value of Red mana to create. * @return a {@link Mana} object with the passed in {@code num} of Red mana. */ public static Mana RedMana(int num) { return new Mana(notNegative(num, "Red"), 0, 0, 0, 0, 0, 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Black * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of Black mana to create. * @return a {@link Mana} object with the passed in {@code num} of Black * mana. */ public static Mana BlackMana(int num) { return new Mana(0, 0, 0, 0, notNegative(num, "Black"), 0, 0, 0); }
/** * Creates a {@link Mana} object with the passed in {@code num} of Colorless * mana. {@code num} can not be a negative value. Negative values will be * logged and set to 0. * * @param num value of Colorless mana to create. * @return a {@link Mana} object with the passed in {@code num} of Colorless * mana. */ public static Mana ColorlessMana(int num) { return new Mana(0, 0, 0, 0, 0, 0, 0, notNegative(num, "Colorless")); }