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); } }
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(); }
public void ReduceArea(int area, int costOfOneCentimeter) { Square.ReduceArea(area); Cashbox.Sell(area * costOfOneCentimeter); }
public void ExpandArea(int area, int costOfOneCentimeter) { Cashbox.Buy(area * costOfOneCentimeter); Square.ExpandArea(area); }
public Emporium(string name, int budget) { Name = name; Cashbox = new Cashbox(budget); Square = new Square(0); }