Exemple #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Cashbox != null ? Cashbox.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Square != null ? Square.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Departments != null ? Departments.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #2
0
 public void ShowInformation()
 {
     Console.WriteLine($@"Название: {Name}");
     Console.WriteLine($@"Площадь универмага: {(double)Square.Area /10000:0,0.0} м^2");
     Console.WriteLine($@"Свободная площадь:  {(double)Square.FreeArea /10000:0,0.0} м^2");
     Cashbox.ShowFinances();
     foreach (var department in Departments)
     {
         department.ShowInformation();
     }
     Console.WriteLine();
 }
Exemple #3
0
 public void ReduceArea(int area, int costOfOneCentimeter)
 {
     Square.ReduceArea(area);
     Cashbox.Sell(area * costOfOneCentimeter);
 }
Exemple #4
0
 public void ExpandArea(int area, int costOfOneCentimeter)
 {
     Cashbox.Buy(area * costOfOneCentimeter);
     Square.ExpandArea(area);
 }
Exemple #5
0
 public Emporium(string name, int budget)
 {
     Name    = name;
     Cashbox = new Cashbox(budget);
     Square  = new Square(0);
 }