Example #1
0
        public bool Equals(AnimalMarked animal)
        {
            if (Object.ReferenceEquals(animal, null))
            {
                return(false);
            }
            if (this.GetType() != animal.GetType())
            {
                return(false);
            }

            return((ChipId == animal.ChipId) && (Name == animal.Name));
        }
 //funkcija gražins surikiuotą gyvūnų sąrašą
 private static AnimalMarked[] SortAnimals(AnimalMarked[] animals, int animalCount)
 {
     for (int i = 0; i < animalCount - 1; i++)
     {
         AnimalMarked minValueAnimal = animals[i];
         int          minValueIndex  = i;
         for (int j = i + 1; j < animalCount; j++)
         {
             if (animals[j] <= minValueAnimal)
             {
                 minValueAnimal = animals[j];
                 minValueIndex  = j;
             }
         }
         animals[minValueIndex] = animals[i];
         animals[i]             = minValueAnimal;
     }
     return(animals);
 }