private void ConvertCabinFever(CabinFeverSaveDataProxy proxy)
 {
     if (proxy == null)
     {
         return;
     }
     if (proxy.m_Active)
     {
         Negative.Add(new CabinFever(negative)
         {
             AfflictionType = AfflictionType.CabinFever,
             Location       = 0,
             ElapsedHours   = proxy.m_ElapsedHours,
         });
     }
     else if (proxy.m_RiskActive)
     {
         Negative.Add(new CabinFever(negative)
         {
             AfflictionType = AfflictionType.CabinFeverRisk,
             Location       = 0,
             ElapsedHours   = proxy.m_ElapsedHours,
         });
     }
 }
 private void ConvertHypothermia(HypothermiaSaveDataProxy proxy)
 {
     if (proxy == null)
     {
         return;
     }
     if (proxy.m_Active)
     {
         Negative.Add(new Hypothermia(negative)
         {
             AfflictionType   = AfflictionType.Hypothermia,
             Location         = 6,
             ElapsedHours     = proxy.m_ElapsedHours,
             ElapsedWarmHours = proxy.m_ElapsedHours,
             Cause            = proxy.m_CauseLocID,
         });
     }
     else if (proxy.m_ElapsedHours > 0)
     {
         Negative.Add(new Hypothermia(negative)
         {
             AfflictionType   = AfflictionType.HypothermiaRisk,
             Location         = 6,
             ElapsedHours     = proxy.m_ElapsedHours,
             ElapsedWarmHours = proxy.m_ElapsedHours,
             Cause            = proxy.m_CauseLocID,
         });
     }
 }
Esempio n. 3
0
 private void ConvertFrostbite(FrostbiteSaveDataProxy proxy)
 {
     if (proxy == null)
     {
         return;
     }
     foreach (int bodyArea in proxy.m_LocationsWithActiveFrostbite)
     {
         Negative.Add(new Frostbite(negative)
         {
             AfflictionType = AfflictionType.Frostbite,
             Location       = bodyArea,
             Damage         = proxy.m_LocationsCurrentFrostbiteDamage[bodyArea],
         });
     }
     foreach (int bodyArea in proxy.m_LocationsWithFrostbiteRisk)
     {
         Negative.Add(new Frostbite(negative)
         {
             AfflictionType = AfflictionType.FrostbiteRisk,
             Location       = bodyArea,
             Damage         = proxy.m_LocationsCurrentFrostbiteDamage[bodyArea],
         });
     }
 }
Esempio n. 4
0
 public Node UnaryExpression()
 {
     if (CurrentToken == TokenCategory.NOT)
     {
         var result = new Not()
         {
             AnchorToken = Expect(TokenCategory.NOT)
         };
         result.Add(UnaryExpression());
         return(result);
     }
     else if (CurrentToken == TokenCategory.MINUS)
     {
         var result = new Negative()
         {
             AnchorToken = Expect(TokenCategory.MINUS)
         };
         result.Add(UnaryExpression());
         return(result);
     }
     else if (firstOfSimpleExpression.Contains(CurrentToken))
     {
         return(SimpleExpression());
     }
     else
     {
         throw new SyntaxError(firstOfUnaryExpression, tokenStream.Current);
     }
 }
 private void ConvertBurnsElectric(BurnsElectricSaveDataProxy proxy)
 {
     if (proxy == null || !proxy.m_Active)
     {
         return;
     }
     Negative.Add(new BurnsElectric(negative)
     {
         AfflictionType   = AfflictionType.BurnsElectric,
         Location         = 3,
         BandageApplied   = proxy.m_BandageApplied,
         DurationHours    = proxy.m_DurationHours,
         ElapsedHours     = proxy.m_ElapsedHours,
         PainKillersTaken = proxy.m_PainKillersTaken,
     });
 }
 private void ConvertDysentery(DysenterySaveDataProxy proxy)
 {
     if (proxy == null || !proxy.m_Active)
     {
         return;
     }
     Negative.Add(new Dysentery(negative)
     {
         AfflictionType     = AfflictionType.Dysentery,
         Location           = 7,
         AntibioticsTaken   = proxy.m_AntibioticsTaken,
         CleanWaterConsumed = proxy.m_CleanWaterConsumedLiters,
         DurationHours      = proxy.m_DurationHours,
         ElapsedHours       = proxy.m_ElapsedHours,
         ElapsedRest        = proxy.m_ElapsedRest,
     });
 }
 private void ConvertFoodPoisoning(FoodPoisoningSaveDataProxy proxy)
 {
     if (proxy == null || !proxy.m_Active)
     {
         return;
     }
     Negative.Add(new FoodPoisoning(negative)
     {
         AfflictionType   = AfflictionType.FoodPoisioning,
         Location         = 6,
         AntibioticsTaken = proxy.m_AntibioticsTaken,
         Cause            = proxy.m_CauseLocID,
         DurationHours    = proxy.m_DurationHours,
         ElapsedHours     = proxy.m_ElapsedHours,
         ElapsedRest      = proxy.m_ElapsedHours,
     });
 }
 private void ConvertBloodLoss(BloodLossSaveDataProxy proxy)
 {
     if (proxy == null || proxy.m_CausesLocIDs == null)
     {
         return;
     }
     for (int i = 0; i < proxy.m_DurationHoursList.Count; i++)
     {
         Negative.Add(new BloodLoss(negative)
         {
             AfflictionType = AfflictionType.BloodLoss,
             Location       = proxy.m_Locations[i],
             CauseLocID     = proxy.m_CausesLocIDs[i],
             DurationHours  = proxy.m_DurationHoursList[i],
             ElapsedHours   = proxy.m_ElapsedHoursList[i],
         });
     }
 }
 private void ConvertBrokenRib(BrokenRibSaveDataProxy proxy)
 {
     if (proxy == null || proxy.m_CausesLocIDs == null)
     {
         return;
     }
     for (int i = 0; i < proxy.m_Locations.Count; i++)
     {
         Negative.Add(new BrokenRib(negative)
         {
             AfflictionType      = AfflictionType.BrokenRib,
             Location            = proxy.m_Locations[i],
             BandagesApplied     = proxy.m_BandagesApplied[i],
             ElapsedRest         = proxy.m_ElapsedRestList[i],
             NumHoursRestForCure = proxy.m_NumHoursRestForCureList[i],
             PainKillersTaken    = proxy.m_PainKillersTaken[i],
         });
     }
 }
 private void ConvertSprainedWrist(SprainedWristSaveDataProxy proxy)
 {
     if (proxy == null || proxy.m_CausesLocIDs == null)
     {
         return;
     }
     for (int i = 0; i < proxy.m_ElapsedHoursList.Count; i++)
     {
         Negative.Add(new SprainAffliction(negative)
         {
             AfflictionType = AfflictionType.SprainedWrist,
             Location       = proxy.m_Locations[i],
             CauseLocID     = proxy.m_CausesLocIDs[i],
             Duration       = proxy.m_DurationHoursList[i],
             ElapsedHours   = proxy.m_ElapsedHoursList[i],
             ElapsedRest    = proxy.m_ElapsedRestList[i],
         });
     }
 }
        private void ConvertFrostbite(FrostbiteSaveDataProxy proxy)
        {
            if (proxy == null)
            {
                return;
            }

            var frostbiteDamage = new List <float>(proxy.m_LocationsCurrentFrostbiteDamage);

            foreach (int bodyArea in proxy.m_LocationsWithActiveFrostbite)
            {
                Negative.Add(new Frostbite(negative)
                {
                    AfflictionType = AfflictionType.Frostbite,
                    Location       = bodyArea,
                    Damage         = proxy.m_LocationsCurrentFrostbiteDamage[bodyArea],
                });
                frostbiteDamage[bodyArea] = 0;
            }
            foreach (int bodyArea in proxy.m_LocationsWithFrostbiteRisk)
            {
                Negative.Add(new Frostbite(negative)
                {
                    AfflictionType = AfflictionType.FrostbiteRisk,
                    Location       = bodyArea,
                    Damage         = proxy.m_LocationsCurrentFrostbiteDamage[bodyArea],
                });
                frostbiteDamage[bodyArea] = 0;
            }
            for (int i = 0; i < frostbiteDamage.Count; i++)
            {
                if (frostbiteDamage[i] > 0)
                {
                    Negative.Add(new Frostbite(negative)
                    {
                        AfflictionType = AfflictionType.FrostbiteDamage,
                        Location       = i,
                        Damage         = frostbiteDamage[i],
                    });
                }
            }
        }
 private void ConvertInfectionRisk(InfectionRiskSaveDataProxy proxy)
 {
     if (proxy == null || proxy.m_CausesLocIDs == null)
     {
         return;
     }
     for (int i = 0; i < proxy.m_DurationHoursList.Count; i++)
     {
         Negative.Add(new InfectionRisk(negative)
         {
             AfflictionType         = AfflictionType.InfectionRisk,
             Location               = proxy.m_Locations[i],
             AntisepticTaken        = proxy.m_AntisepticTakenList[i],
             CauseLocID             = proxy.m_CausesLocIDs[i],
             CurrentInfectionChance = proxy.m_CurrentInfectionChanceList[i],
             DurationHours          = proxy.m_DurationHoursList[i],
             ElapsedHours           = proxy.m_ElapsedHoursList[i],
         });
     }
 }
 private void ConvertInfection(InfectionSaveDataProxy proxy)
 {
     if (proxy == null || proxy.m_DurationHoursList == null)
     {
         return;
     }
     for (int i = 0; i < proxy.m_DurationHoursList.Count; i++)
     {
         Negative.Add(new Infection(negative)
         {
             AfflictionType   = AfflictionType.Infection,
             Location         = proxy.m_Locations[i],
             AntibioticsTaken = proxy.m_AntibioticsTakenList[i],
             CauseLocID       = proxy.m_CausesLocIDs[i],
             DurationHours    = proxy.m_DurationHoursList[i],
             ElapsedHours     = proxy.m_ElapsedHoursList[i],
             ElapsedRest      = proxy.m_ElapsedRestList[i],
         });
     }
 }
 private void ConvertIntestinalParasites(IntestinalParasitesSaveDataProxy proxy)
 {
     if (proxy == null)
     {
         return;
     }
     if (proxy.m_HasParasites || proxy.m_HasParasiteRisk)
     {
         var affliction = proxy.m_HasParasites ? AfflictionType.IntestinalParasites : AfflictionType.IntestinalParasitesRisk;
         Negative.Add(new IntestinalParasites(negative)
         {
             AfflictionType           = affliction,
             Location                 = 7,
             CurrentInfectionChance   = proxy.m_CurrentInfectionChance,
             DayToAllowNextDose       = proxy.m_DayToAllowNextDose,
             DosesTaken               = proxy.m_NumDosesTaken,
             HasTakenDoseToday        = proxy.m_HasTakenDoseToday,
             ParasitesElapsedHours    = proxy.m_ParasitesElapsedHours,
             PiecesEatenThisRiskCycle = proxy.m_NumPiecesEatenThisRiskCycle,
             RiskDurationHours        = proxy.m_RiskDurationHours,
             RiskElapsedHours         = proxy.m_RiskElapsedHours,
         });
     }
 }