Beispiel #1
0
 public Area(Place pl, string nameInCountry, int co, float sq)
 {
     nameOfArea      = nameInCountry;
     nameOfContinetn = pl.nameOfContinetn;
     latitude        = pl.latitude;
     longitude       = pl.longitude;
     countOfCity     = co;
     squearOfArea    = sq;
     placeSaver      = (Place)pl.Clone();
 }
Beispiel #2
0
 public Area(Place pl, Random rnd)
 {
     nameOfArea      = RandomWord();
     countOfCity     = rnd.Next(1, 100);
     placeSaver      = (Place)pl.Clone();
     nameOfContinetn = pl.nameOfContinetn;
     latitude        = pl.latitude;
     longitude       = pl.longitude;
     squearOfArea    = rnd.Next(100, 1000000) + ((float)rnd.Next(0, 100)) / 100;
 }
Beispiel #3
0
        public void ClonePlace()
        {
            //Arrange
            Place place = new Place("Место");

            //Act
            Place clone = (Place)place.Clone();

            //Assert
            Assert.IsTrue(clone.Name == $"{place.Name}");
        }
Beispiel #4
0
        /// <summary>
        /// Clones the block sounds.
        /// </summary>
        /// <returns></returns>
        public BlockSounds Clone()
        {
            BlockSounds sounds = new BlockSounds()
            {
                Walk              = Walk == null ? null : Walk.Clone(),
                Inside            = Inside == null ? null : Inside.Clone(),
                Break             = Break == null ? null : Break.Clone(),
                Place             = Place == null ? null : Place.Clone(),
                Hit               = Hit == null ? null : Hit.Clone(),
                Ambient           = Ambient == null ? null : Ambient.Clone(),
                AmbientBlockCount = AmbientBlockCount
            };

            foreach (var val in ByTool)
            {
                sounds.ByTool[val.Key] = val.Value.Clone();
            }

            return(sounds);
        }