public double valorConsumos(int piso, int nQuarto) { for (int i = 0; i < quartos.Count; i++) { if (quartos[i] is QuartoSuper && quartos[i].Piso == piso && quartos[i].Numero == nQuarto) { QuartoSuper super = (QuartoSuper)quartos[i]; return(super.getTotalConsumos()); } } return(-1); }
// Retorna a lista de Consumos public static List <double> getConsumosById(int idQuarto) { for (int i = 0; i < quartos.Count; i++) { if (quartos[i] is QuartoSuper && quartos[i].Id == idQuarto) { QuartoSuper super = (QuartoSuper)quartos[i]; return(super.getConsumos()); } } return(null); }
// Retorna a lista de Consumos public static double getTotalConsumosById(int idQuarto) { for (int i = 0; i < quartos.Count; i++) { if (quartos[i] is QuartoSuper && quartos[i].Id == idQuarto) { QuartoSuper super = (QuartoSuper)quartos[i]; return(super.getTotalConsumos()); } } return(0); }
public List <QuartoSuper> quartosConsumosSuperiorA(double consumo) { List <QuartoSuper> newList = new List <QuartoSuper>(); for (int i = 0; i < quartos.Count; i++) { if (quartos[i] is QuartoSuper) { QuartoSuper super = (QuartoSuper)quartos[i]; if (super.getTotalConsumos() > consumo) { newList.Add(super); } } } return(newList); }