예제 #1
0
        public override object Clone()
        {
            Place      clone  = new Place(this.Latitude, this.Longitude);
            Area       clone1 = new Area(clone, this.NameOfArea, this.NameOfContinetn, this.CountOfCity, this.SquearOfArea);
            City       clone2 = new City(clone1, this.NameOfCity, this.CountOfPeople, this.SquearOfCity);
            Megapolice clone3 = new Megapolice(clone2, this.CountOfAglommeration);

            return(new Address(clone3, this.streatName, this.numberOfStreat));
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            Megapolice p = (Megapolice)obj;

            return((latitude == p.Latitude) && (longitude == p.Longitude));
        }
예제 #3
0
 public Address(Megapolice megapolice, string name, int num)
 {
     latitude             = megapolice.Latitude;
     longitude            = megapolice.Longitude;
     nameOfContinetn      = megapolice.NameOfContinetn;
     nameOfArea           = megapolice.NameOfArea;
     countOfCity          = megapolice.CountOfCity;
     squearOfArea         = megapolice.SquearOfArea;
     countOfPeople        = megapolice.CountOfPeople;
     nameOfCity           = megapolice.NameOfCity;
     squearOfCity         = megapolice.SquearOfCity;
     countOfAglommeration = megapolice.CountOfAglommeration;
     placeSaver           = (Place)megapolice.placeSaver.Clone();
     streatName           = name;
     numberOfStreat       = num;
 }
예제 #4
0
        public MyCollection(Random Rnd)
        {
            int len = Rnd.Next(1, 100);

            for (int i = 0; i < len; i++)
            {
                switch (Rnd.Next(1, 5))
                {
                case 1:
                    Place ad = new Place(Rnd);
                    list.Add(ad);
                    break;

                case 2:
                    Area add = new Area(Rnd);
                    list.Add(add);
                    break;

                case 3:
                    City addd = new City(Rnd);
                    list.Add(addd);
                    break;

                case 4:
                    Megapolice adddd = new Megapolice(Rnd);
                    list.Add(adddd);
                    break;

                case 5:
                    Address addddd = new Address(Rnd);
                    list.Add(addddd);
                    break;
                }
            }
            numNow = 0;
        }