Ejemplo n.º 1
0
 /**
  * <summary>
  * Initializes a Person object with a specific name as well as test day and optionally an infection status and length.
  * </summary>
  *
  * <param name="name">The name of the person being created</param>
  * <param name="testDay">The day the person will get tested. Should be in [0, 7)</param>
  * <param name="status">The optional infection status of the person</param>
  * <param name="covidLength">The length the person has had covid</param>
  */
 public Person(String name, int testDay, InfectedStatus status = InfectedStatus.Susceptible, int covidLength = 0)
 {
     _name              = name;
     _status            = status;
     _daysSinceReceived = covidLength;
     _testDay           = testDay;
 }
Ejemplo n.º 2
0
 /**
  * <summary>
  * Initializes a Person object with a specific name and optionally an infection status and length.
  * Sets the test day to a random number between [0, 5)
  * </summary>
  *
  * <param name="name">The name of the person being created</param>
  * <param name="status">The optional infection status of the person</param>
  * <param name="covidLength">The length the person has had covid</param>
  */
 public Person(String name, InfectedStatus status = InfectedStatus.Susceptible, int covidLength = 0)
 {
     _name              = name;
     _symptom           = Symptom.Asymptomatic;
     _status            = status;
     _daysSinceReceived = covidLength;
     _testDay           = Program.Rand.Next(0, 5);
 }
Ejemplo n.º 3
0
 /**
  * <summary>
  * Infects this Person ONLY IF they are currently susceptible
  * </summary>
  */
 public void Infect()
 {
     if (_status == InfectedStatus.Susceptible)
     {
         Program.DebugPrint(_name + " was infected");
         _status  = InfectedStatus.Infected;
         _symptom = SymptomRarity.GetSymptom();
         UpdateInfectionDay();
     }
 }
Ejemplo n.º 4
0
 /**
  * <summary>
  * Set this Person's infection status to recovered.
  * </summary>
  */
 public void Recover()
 {
     Program.DebugPrint(_name + " recovered");
     _status = InfectedStatus.Recovered;
 }