public int AdicionarInstrumento(Instrumento intr) { if (this.Toca[0] != null) { throw new Exception("O integrante já tem instrumento atrinbuído"); } this.Toca[0] = intr; return(Toca.Length); }
public int TrocarInstrumento(Instrumento intr) { if (this.Toca[0] == null) { throw new Exception("O integrante não tem instrumento atribuído"); } this.Toca[0] = intr; return(Toca.Length); }
public Integrante(string nome, Instrumento instr) { this.Toca = new Instrumento[1]; Nome = nome; Toca[0] = instr; }