Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Tenant pers1 = new Tenant("Dima", "I");
            Tenant pers2 = new Tenant("Serg", "Z");
            Tenant pers3 = new Tenant("Sasha", "B");
            Tenant pers4 = new Tenant("Serg", "RZ");
            Tenant pers5 = new Tenant("Yulya", "G");
            Tenant pers6 = new Tenant("Olena", "K");
            Tenant pers7 = new Tenant("Ruslan", "M");
            Tenant pers8 = new Tenant("Tanya", "N");

            Flat flat1 = new Flat(new List <Tenant>()
            {
                pers1, pers2
            }, 46);
            Flat flat2 = new Flat(new List <Tenant>()
            {
                pers4, pers3
            }, 60);
            Flat flat3 = new Flat(new List <Tenant>()
            {
                pers5, pers6, pers7
            }, 33);
            Flat flat4 = new Flat(new List <Tenant>()
            {
                pers8
            }, 90);

            HomeFabrica homeFabrica = new HomeFabrica();
            Home        home        = homeFabrica.CreateHome(new List <Flat>()
            {
                flat1, flat2, flat3, flat4
            });
        }
Exemplo n.º 2
0
        public static double CalculateAll(Flat flat)
        {
            double res = 0;

            res += CalculateElectricity(flat);
            res += CalculateWater(flat);
            res += CalculateSupport(flat);
            return(res);
        }
Exemplo n.º 3
0
 public static double CalculateSupport(Flat flat)
 {
     return(priceSupport * flat.Area);
 }
Exemplo n.º 4
0
 public static double CalculateWater(Flat flat)
 {
     return(priceWater * (flat.Tenants.Count * 20));
 }
Exemplo n.º 5
0
 public static double CalculateElectricity(Flat flat)
 {
     return(priceElectricity * (flat.Tenants.Count * 100));
 }