private void AddInfectionTarget(string name, Infectable target)
 {
     if (infectionTargets.ContainsKey(target.name) == false)
     {
         infectionTargets.Add(target.name, target);
     }
 }
        public void SetInfection(Infectable iv)
        {
            //only agents have a random start for infection - shold they though?
            if (iv.infectionForm == InfectionForm.AGENT)
            {
                cumulativeChanceInfected += rateCustomerInfected;
                if (cumulativeChanceInfected > Random.Range(0, 100))
                {
                    iv.infectionState        = GetInfectionState();
                    cumulativeChanceInfected = 0;
                    iv.Collider.radius       = baseInfectionRadius;
                }
                else
                {
                    iv.Collider.radius = baseUnInfectedRadius;
                }

                iv.UpdateInfectionStatus();

                if (iv.infectionState == InfectionState.NONE)
                {
                    return;
                }

                if (iv.mask)
                {
                    iv.Collider.radius = iv.Collider.radius + protectedIR;
                }
                else
                {
                    iv.Collider.radius = iv.Collider.radius + unprotectedIR;
                }
            }
        }
        public void InfectTarget(Infectable target)
        {
            if (target != null && target.infectionState == InfectionState.NONE)
            {
                switch (target.infectionForm)
                {
                case InfectionForm.AGENT:
                {
                    var r0 = target.mask ? protectedHR : unprotectedHR;
                    if (target.cumulativeTime * r0 > Random.Range(0, 100.0f))
                    {
                        Infect(target, InfectionState.INFECTED, true);
                    }
                }
                break;

                case InfectionForm.WAYPOINT:
                {
                    var r0 = target.mask ? protectedHR : unprotectedHR;
                    if (target.cumulativeTime * r0 > Random.Range(0, 100.0f))
                    {
                        Infect(target, InfectionState.CONTAGIOUS_ASYMPTOMATIC, false);
                    }
                }
                break;
                }
            }
        }
 private void Infect(Infectable target, InfectionState state, bool addToMap)
 {
     if (logInfections)
     {
         DebugHelper.Log(Color.red, "Infected {0}".Format(target.name));
     }
     target.infectionState = state;
     if (addToMap)
     {
         AddInfectionMap(target.transform.position);
     }
 }
        public Material GetStatusMaterial(Infectable iv, InfectionState lastState)
        {
            switch (iv.infectionForm)
            {
            case InfectionForm.AGENT:
                return(agentInfectionMaterials[(int)lastState]);

            case InfectionForm.WAYPOINT:
                return(wayInfectionMaterials[(int)lastState]);

            default:
                return(wayInfectionMaterials[(int)lastState]);
            }
        }