public static Tempera operator +(Tempera t1, Tempera t2) { Tempera t3 = new Tempera(t1._cantidad, t1._color, t1._marca); if (t1 == t2) { t3 += t2._cantidad; } return(t3); }
public static Tempera operator +(Tempera temp1, Tempera temp2) { Tempera retorno = new Tempera(temp1._cantidad, temp1._color, temp1._marca); if (temp1 == temp2) { retorno._cantidad += temp2._cantidad; } return(retorno); }
private int ObtenerIndice(Tempera t) { int indice = -1; int i; for (i = 0; i < this._cantMaximaelementos; i++) { if (this._colores.GetValue(i) != null && this._colores[i] == t) { indice = i; } } return(indice); }
private int ObtenerIndice(Tempera t) //busca si la tempera que pasamos es igual a alguna que este en la paleta { int retorno = -1; int i; for (i = 0; i < this._cantMaximaElementos; i++) { if (this._colores.GetValue(i) != null) { if (this._colores[i] == t) { retorno = i; break; } } } return(retorno); }