1
0
oop-1-labs/Lab5/Lab5.Exercises.Register/Dog.cs

28 lines
808 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Lab5.Exercises.Register
{
class Dog : VaccinatedAnimal
{
private const int VaccinationDuration = 1;
public bool Aggresive { get; set; }
public Dog(int id, string name, string breed, DateTime birthDate, Gender gender, bool aggresive) : base(id, name, breed, birthDate, gender)
{
this.Aggresive = aggresive;
}
public override bool RequiresVaccination
{
get
{
if (LastVaccinationDate.Equals(DateTime.MinValue))
{
return true;
}
return LastVaccinationDate.AddYears(VaccinationDuration).CompareTo(DateTime.Now) < 0;
}
}
}
}