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, }); } }
private HypothermiaSaveDataProxy ConvertBackHypothermia(HypothermiaSaveDataProxy proxy, Dictionary <AfflictionType, List <Affliction> > afflictionDict) { proxy = proxy ?? new HypothermiaSaveDataProxy(); if (!afflictionDict.ContainsKey(AfflictionType.Hypothermia) && !afflictionDict.ContainsKey(AfflictionType.HypothermiaRisk)) { return((proxy?.m_ElapsedHours > 0) ? new HypothermiaSaveDataProxy() : proxy); } proxy.m_Active = afflictionDict.ContainsKey(AfflictionType.Hypothermia); var hypothermia = (Hypothermia)(proxy.m_Active ? afflictionDict[AfflictionType.Hypothermia][0] : afflictionDict[AfflictionType.HypothermiaRisk][0]); proxy.m_ElapsedHours = hypothermia.ElapsedHours; proxy.m_ElapsedWarmTime = hypothermia.ElapsedWarmHours; proxy.m_CauseLocID = hypothermia.Cause; return(proxy); }